|
yes, agree. But what is an empty value for Date? - It is "12:00:00 AM", empty for Integer - 0. But 0 in my case is a number and anyway the values will be shown in datagridview. It's confusing, so, I'm looking for a way to show just empty cell instead 0 or 12:00:00 AM... Thank you.
|
|
|
|
|
I have no idea what your problem is here. You're editing values in the grid ? Why do you have empty values to start with, and why are they showing these values if they are empty ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have to display a group of contacts in datagrid - not editable. Fields are first name, last name, and dob (to keep it simple). DOB is not required, so for contacts who didn't specify their DOB I'd like to display nothing. But I'm getting 12:00:00 AM, which is confusing, because there is no such date for birthday. Once again, because I use binding, when DBNull comes to the place (DOB is empty in a database), it's converted into 12:00:00 AM automatically in a datagrid
|
|
|
|
|
Why don't you turn the date into a string in your data source then ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
first of all, how . And then, I have about 20-30 fields for each contact, and may have over 100000 contacts in a database. It will slow down
|
|
|
|
|
irapov wrote: first of all, how
Easy - you're returning the data from a stored proc, surely ? So, turn it into a string there. Or, if you prefer, iterate through the data again before passing it over to the datagrid. Or ( best option IMO ), databind on a function which returns either the date as a string, or an empty string if it's DBNull.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
In datagrid_itemdatabound event check for the dob, if it is no value or null set visible false for that particular cell
check for dob if no value then
e.item.cells("dob").visible=false
Jv
|
|
|
|
|
thanks so much, I've got the idea. The only problem that visible is readonly property.
|
|
|
|
|
Hi. I'm doing a project that i need to send information to a VB6 program when my machine stop. The operator must put in a job nr to restart the machine. If the nr is the same as the current job the machine must start. If not the same the VB6 program must verify that a new job will be done. The plc used is a AB SLC 503. I am new to VB6. Can anyone help me with this.
R.Cerva, South Africa
|
|
|
|
|
You're asking a very general question about a very specific (and not very often seen) application for some very specific hardware.
On top of that, you've got little to no experience with VB? Yikes!
You're best shot is Googling for something like "VB6 PLC" and see what you can understand. You're most definately not going to come up with something pre-written or "cut-n-pastable".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
please
I want to control pc via bluetooth by using vb.net
or any .net progrmme
|
|
|
|
|
Hello,
Dim obj As New Microsoft.Win32.RegistryKey
I could not create a new object of Registrykey.This class is a encapsulation method
I got the error( Overload resolution failed because no 'New' is accessible).How can I develop this type class.Please help me
Continue...
|
|
|
|
|
If you're trying to create a new subkey in the registry, you're doing it wrong. Registry and RegistryKey are essentially class factories that create and return new RegistryKey objects.
Dim myNewKey As RegistryKey = Registry.LocalMachine.CreateSubKey("mySubKey")
This will open the Local Machine hive, create a new subkey off of the root of Local Machine, then return the RegistryKey object representing the new subkey.
You can the use that object to create values in the new key.
myNewKey.SetValue("valueName", value)
' Don't forget to Flush! ;) This forces the Registry to commit changes to disk immediately.
' You don't have to call Flush if waiting for the lazy flusher to commit to disk is OK.
myNewKey.Flush()
' You do have to call Close when you done reading/making changes.
myNewKey.Close()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Free Visual Basic.NET videos at http://www.vbdotnet.somee.com
please reply for any ideas or comments
|
|
|
|
|
Hi, I need to build an application which will send the large picture (around 800kb) via an e-mail using dial up networking connection. I want to send the data very fast in order to reduce total cose and reduce time consuming. Does any one know how to use any method to send a graphic file over an internet by using a slow connection? Does the graphic need to convert to any data type before send over an internet?
|
|
|
|
|
Theres nothing special about sending an email down a slow write compared to sending it over broadband.
If you want to reduce the bytes sent for this picture, and thus speed up sending it, you're going to have to sacrifice something to do it. This is usually the image size and/or quality.
Reducing the dimensions (size) of the image will quickly take care of the problem, but now the recipient has a much smaller picture to look at.
Re-encoding an image to a .JPG image, like converting a .BMP image to a .JPG, will also reduce the size (in bytes) of the image, but it also sacrifices image quality. If the image is already a .JPG, you'll have to specify a higher compression when you convert the image to another .JPG file, thus further sacrificing image quality.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Are there any possible way to convert an image to any format (example: a small text code format) and send over an e-mail then rebuild the picture after it arrive at its destination?
|
|
|
|
|
Converting the byte stream to a Base64 encoded text, but this will actually make the file BIGGER. There is no way to convert it to a smaller number of bytes without sacrificing something.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi I have a file that has come form a UNIX machine, which I believe was part of a database! What I would like to do is convert it to a plain text file, the file itself is readable but has a lot of non-standard characters which I need to strip out, can this be done, here is a small sample of the file
1206051101_P2E2880 OOW03313P 2011CHRX DARTFD S EMU 0000124659005 090D SE_________ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_______
ÿÿÿÿÿÿÿÿ0706052258_P2E3080 OOW03315P 2041CHRX DARTFD S EMU 0000124659005 090D SE_________ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ___
____ÿÿÿÿÿÿÿÿ0706052258_P2E3480 OOW03321P 2141CHRX DARTFD S EMU 0000124659005 090D SE_________ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_______ ÿÿÿÿÿÿÿÿ
The parts that I’m interested in reading is OOW03315P 2041CHRX DARTFD S EMU, P2E3480 OOW03321P 2141CHRX DARTFD S EMU etc and removing the rest can this be done?
Cheers for any info
Darren
|
|
|
|
|
If you have an interest in only digits, letters, and whitespace, then the following code should do what you want:
' sourcePath is your source file.
' destPath is your destination file.
Dim sr As System.IO.StreamReader = System.IO.File.OpenText(sourcePath)
Dim s As String = sr.ReadToEnd()
sr.Close()
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder(s.Length)
Dim i As Integer
For i = 0 To s.Length - 1
If Char.IsLetterOrDigit(s.Chars(i)) OrElse Char.IsWhiteSpace(s.Chars(i)) Then
sb.Append(s.Chars(i))
End If
Next
Dim sw As System.IO.StreamWriter = New System.IO.StreamWriter(destPath)
sw.Write(sb.ToString())
sw.Close()
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thank You, Works a treat...
Darren
|
|
|
|
|
|
The best thing to do is invest some time in regular expressions. You'll get much better results and not get any hard-to-locate cases where your changes destroyed or modified good data.
Andrew Peters
Fabrefactum Software
|
|
|
|
|
Hello
I wrote a form-based VB.NET application that also updates registy, uses 'common file-open dialog' and more.
It works perfectly.
The Problem:
When i run the exe file from another computer in the network, I get many security permission exceptions.
I get them when i try to :
* deal with registry
* when i access the common-dialog
* EVEN when i use 'END' statement to shut the application !
It can be solved by setting local .net framework security permissions on each computer. but im not satisfied with this solution. Is there any other solution in the programming-level??
Thanks ahead for an answer.
Uri
|
|
|
|
|
There is no programmatic way to get the permissions, since code running from a network source is not trusted. You MUST set this up either on each machine, or by using Group Policies in a domain environment.
Chapter 8 – Code Access Security in Practice[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|