Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB.NET SQL Error

VB.NET SQL Error

Scheduled Pinned Locked Moved Visual Basic
databasecsharphelp
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shrimpersfan
    wrote on last edited by
    #1

    I have an application which uses a SQL connection and brings data into a datagridview. The app allows the user to take this data, make changes on it and then save these changes. This is fine when the user only brings back and manipulates around 100 - 1000 records, when the recordset is higher than this, all records that have been manipulated get inserted into the database apart from 1 record. The error message within the application says 'Cannot insert NULL value into column 'QuoteID', column does not insert NULL's. Insert failed. The app always brings back this error when using a large recordset, when i look in the db to see how many had been imported, every record is saved except one. Just wondering if anyone had come across something like this before.

    R 1 Reply Last reply
    0
    • S Shrimpersfan

      I have an application which uses a SQL connection and brings data into a datagridview. The app allows the user to take this data, make changes on it and then save these changes. This is fine when the user only brings back and manipulates around 100 - 1000 records, when the recordset is higher than this, all records that have been manipulated get inserted into the database apart from 1 record. The error message within the application says 'Cannot insert NULL value into column 'QuoteID', column does not insert NULL's. Insert failed. The app always brings back this error when using a large recordset, when i look in the db to see how many had been imported, every record is saved except one. Just wondering if anyone had come across something like this before.

      R Offline
      R Offline
      Rupesh Kumar Swami
      wrote on last edited by
      #2

      Shrimpersfan wrote:

      The error message within the application says 'Cannot insert NULL value into column 'QuoteID', column does not insert NULL's. Insert failed.

      from above message, it is clear that column 'QuoteID' does not allow null value. whether you debug your code for record which have null value for column 'QuoteID'. Check for the last row of datagridview which may be contain null value for column 'QuoteID' (or for all fields)

      Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

      S 1 Reply Last reply
      0
      • R Rupesh Kumar Swami

        Shrimpersfan wrote:

        The error message within the application says 'Cannot insert NULL value into column 'QuoteID', column does not insert NULL's. Insert failed.

        from above message, it is clear that column 'QuoteID' does not allow null value. whether you debug your code for record which have null value for column 'QuoteID'. Check for the last row of datagridview which may be contain null value for column 'QuoteID' (or for all fields)

        Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

        S Offline
        S Offline
        Shrimpersfan
        wrote on last edited by
        #3

        Hi Rupesh. I have looked at the databases and looked for any NULL's in QuoteID but none appear. In my datagrid view, there is a white space below the last field (space to enter another record) but i shouldn't think the app will be trying to import a record from this. It's also strange how the import works with a smaller dataset but not with a large one. I have commandtimeout's in my code too. David

        R 1 Reply Last reply
        0
        • S Shrimpersfan

          Hi Rupesh. I have looked at the databases and looked for any NULL's in QuoteID but none appear. In my datagrid view, there is a white space below the last field (space to enter another record) but i shouldn't think the app will be trying to import a record from this. It's also strange how the import works with a smaller dataset but not with a large one. I have commandtimeout's in my code too. David

          R Offline
          R Offline
          Rupesh Kumar Swami
          wrote on last edited by
          #4

          Shrimpersfan wrote:

          I have commandtimeout's in my code too.

          whether you try to increase CommandTimeOut?

          Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

          S 1 Reply Last reply
          0
          • R Rupesh Kumar Swami

            Shrimpersfan wrote:

            I have commandtimeout's in my code too.

            whether you try to increase CommandTimeOut?

            Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

            S Offline
            S Offline
            Shrimpersfan
            wrote on last edited by
            #5

            Yes i tried different intervals, in the end i used 0 so the app should never time out. David

            R 1 Reply Last reply
            0
            • S Shrimpersfan

              Yes i tried different intervals, in the end i used 0 so the app should never time out. David

              R Offline
              R Offline
              Rupesh Kumar Swami
              wrote on last edited by
              #6

              can you post the code snippet so i review it for some clue?

              Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

              S 1 Reply Last reply
              0
              • R Rupesh Kumar Swami

                can you post the code snippet so i review it for some clue?

                Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

                S Offline
                S Offline
                Shrimpersfan
                wrote on last edited by
                #7

                Well my app uses stored procedures to call up data, will be a lot of code

                R 1 Reply Last reply
                0
                • S Shrimpersfan

                  Well my app uses stored procedures to call up data, will be a lot of code

                  R Offline
                  R Offline
                  Rupesh Kumar Swami
                  wrote on last edited by
                  #8

                  Hmmm. i want to show only the code that how can you update the data from datagridview to database.Most probability is that you can not supply value of column 'QuoteId'( or all field for last record)

                  Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

                  S 1 Reply Last reply
                  0
                  • R Rupesh Kumar Swami

                    Hmmm. i want to show only the code that how can you update the data from datagridview to database.Most probability is that you can not supply value of column 'QuoteId'( or all field for last record)

                    Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

                    S Offline
                    S Offline
                    Shrimpersfan
                    wrote on last edited by
                    #9

                    Hi Rupesh. I seem to have sorted the problem. It seems as though a client had info missing in a completely seperate table. Thanks again. David

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups