• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 538
  • Last Modified:

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
0
FCapo
Asked:
FCapo
  • 2
  • 2
1 Solution
 
CodeCruiserCommented:
This usually happens when you have integer data type involved at some stage. Can you show us your code?
0
 
FCapoAuthor Commented:
my datatypes are set to System.Double for these 2 fields which are connected to number fields in my access database
0
 
itmarsolutionsCommented:
how you saving the values to database ?
0
 
FCapoAuthor Commented:
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
0
 
CodeCruiserCommented:
And do you get error on this update line?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now