Datagridview Blank Value

Posted on 2012-08-22
Last Modified: 2012-08-22

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 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, 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
Question by:FCapo
    LVL 83

    Accepted Solution

    This usually happens when you have integer data type involved at some stage. Can you show us your code?

    Author Comment

    my datatypes are set to System.Double for these 2 fields which are connected to number fields in my access database
    LVL 2

    Expert Comment

    how you saving the values to database ?

    Author Comment

    I basically pass the updated dataset from to my database :

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

        End Function
    LVL 83

    Expert Comment

    And do you get error on this update line?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now