Link to home
Start Free TrialLog in
Avatar of FCapo
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
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FCapo
FCapo

ASKER

my datatypes are set to System.Double for these 2 fields which are connected to number fields in my access database
how you saving the values to database ?
Avatar of FCapo

ASKER

I basically pass the updated dataset from vb.net to my database :

    Public Function savePrjAccessDataset(ByVal prjData As nclMisDataSet) As Boolean
        Try
            prjAccessTableAdapter.Update(prjData)
            Return True
        Catch ex As Exception
        End Try

    End Function
And do you get error on this update line?