FCapo
asked on
Datagridview Blank Value
Hi,
I have a bound datagridview and I'm currently having an issue with null values.
I have 2 fields which are number datatypes, in some cases I have to delete a value in these fields and basically leave it blank, the problem is that vb.net refuses to save a null value to the database for these fields, I have no problem saving null values with string datatypes, but numbers have to be set to 0, so I end up with a table full of 0 values when we need to remove values.
I don't understand why when a field is a string, vb.net can save a null value, but if it's a number, it doesn't seem to detect that the field has changed to a null value; The dataset is set to accept Null values for these fields; I'm not sure what's missing!
Thank you
I have a bound datagridview and I'm currently having an issue with null values.
I have 2 fields which are number datatypes, in some cases I have to delete a value in these fields and basically leave it blank, the problem is that vb.net refuses to save a null value to the database for these fields, I have no problem saving null values with string datatypes, but numbers have to be set to 0, so I end up with a table full of 0 values when we need to remove values.
I don't understand why when a field is a string, vb.net can save a null value, but if it's a number, it doesn't seem to detect that the field has changed to a null value; The dataset is set to accept Null values for these fields; I'm not sure what's missing!
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how you saving the values to database ?
ASKER
I basically pass the updated dataset from vb.net to my database :
Public Function savePrjAccessDataset(ByVal prjData As nclMisDataSet) As Boolean
Try
prjAccessTableAdapter.Upda te(prjData )
Return True
Catch ex As Exception
End Try
End Function
Public Function savePrjAccessDataset(ByVal
Try
prjAccessTableAdapter.Upda
Return True
Catch ex As Exception
End Try
End Function
And do you get error on this update line?
ASKER