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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Problem inserting records

Problem inserting records

Scheduled Pinned Locked Moved C#
databasehelpsql-servergraphicssysadmin
13 Posts 3 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.
  • C Christian Graus

    I'm not gonna trawl through all this code, but in the first instance, you should name your variables something more intelligent than textBox1, textBox2, etc. Christian Graus - Microsoft MVP - C++

    R Offline
    R Offline
    rich_wenger
    wrote on last edited by
    #4

    This is a development version to get past a hump point, it contains only the controls necessary to bind to the dataset and enforce the required business rule constraints. The problem is databinding the selected index of a combobox. If you can't help please stay out of the loop.

    C 1 Reply Last reply
    0
    • L leppie

      You say it fails, but provide no error details, AT ALL! :zzz: xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

      R Offline
      R Offline
      rich_wenger
      wrote on last edited by
      #5

      Sorry, the error I get is 'An unhandled exception of type 'System.Data.NoNullAllowedException' occurred in system.data.dll'; but this error only occurrs if I attempt to insert a record without first performing a search. Otherwise the insert fires successfully but over-writes an existing record (doesn't create a new one).

      C 1 Reply Last reply
      0
      • R rich_wenger

        This is a development version to get past a hump point, it contains only the controls necessary to bind to the dataset and enforce the required business rule constraints. The problem is databinding the selected index of a combobox. If you can't help please stay out of the loop.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #6

        rich_wenger wrote: If you can't help please stay out of the loop. I can help, but first I need to know what is going wrong, and I'm sure not going to read 1000 lines to try and work that out. So you find it easier to work on proof of concept when none of your code is readable ? Brilliant. Christian Graus - Microsoft MVP - C++

        1 Reply Last reply
        0
        • R rich_wenger

          Sorry, the error I get is 'An unhandled exception of type 'System.Data.NoNullAllowedException' occurred in system.data.dll'; but this error only occurrs if I attempt to insert a record without first performing a search. Otherwise the insert fires successfully but over-writes an existing record (doesn't create a new one).

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #7

          This code is unreadable. It also is useless, you've pasted your entire file in here, which tells me you've done nothing to work out exactly where the error is. Do you know how to use the debugger ? I tried to create this project myself to see if it would run ( although I didn't expect it to ), but private ImmediateAccessWIP.dsStaffPhysicians dsStaffPhysicians1; means that no-one can try to run your code to see what's going on. So why post all this boiler plate stuff here ? Debug your code, figure out exactly what is happening, what is being called, and where things go wrong. Then, post the offending code and more people will try to help, because it will look like you did something first, and we'll have some idea where we are looking for a problem. Christian Graus - Microsoft MVP - C++

          R 1 Reply Last reply
          0
          • C Christian Graus

            This code is unreadable. It also is useless, you've pasted your entire file in here, which tells me you've done nothing to work out exactly where the error is. Do you know how to use the debugger ? I tried to create this project myself to see if it would run ( although I didn't expect it to ), but private ImmediateAccessWIP.dsStaffPhysicians dsStaffPhysicians1; means that no-one can try to run your code to see what's going on. So why post all this boiler plate stuff here ? Debug your code, figure out exactly what is happening, what is being called, and where things go wrong. Then, post the offending code and more people will try to help, because it will look like you did something first, and we'll have some idea where we are looking for a problem. Christian Graus - Microsoft MVP - C++

            R Offline
            R Offline
            rich_wenger
            wrote on last edited by
            #8

            I'm sorry. I've assumed that you were familiar with VS2003 you would know everything above the Main() method was IDE generated (therefore it's most likely the problem exits below). I have attempted to debug the code; if you know how to databind a combobox on the selected index that would be of help. Otherwise please end the thread.

            C 1 Reply Last reply
            0
            • R rich_wenger

              I'm sorry. I've assumed that you were familiar with VS2003 you would know everything above the Main() method was IDE generated (therefore it's most likely the problem exits below). I have attempted to debug the code; if you know how to databind a combobox on the selected index that would be of help. Otherwise please end the thread.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #9

              rich_wenger wrote: I've assumed that you were familiar with VS2003 you would know everything above the Main() method was IDE generated But you assumed I'd like to download that code every time I read this page ? And that it's my job to trawl through this IDE generated code to find your stuff ? rich_wenger wrote: I have attempted to debug the code So - what happened ? rich_wenger wrote: if you know how to databind a combobox on the selected index that would be of help How do you mean ? You want to databind one control based on the selected index of another ? rich_wenger wrote: Otherwise please end the thread. This is a community site. I'm a developer who uses this site and is trying to help you, I am not staff on this site. No-one ends threads here, the site doesn't even support thread locking AFAIK. Christian Graus - Microsoft MVP - C++

              R 1 Reply Last reply
              0
              • C Christian Graus

                rich_wenger wrote: I've assumed that you were familiar with VS2003 you would know everything above the Main() method was IDE generated But you assumed I'd like to download that code every time I read this page ? And that it's my job to trawl through this IDE generated code to find your stuff ? rich_wenger wrote: I have attempted to debug the code So - what happened ? rich_wenger wrote: if you know how to databind a combobox on the selected index that would be of help How do you mean ? You want to databind one control based on the selected index of another ? rich_wenger wrote: Otherwise please end the thread. This is a community site. I'm a developer who uses this site and is trying to help you, I am not staff on this site. No-one ends threads here, the site doesn't even support thread locking AFAIK. Christian Graus - Microsoft MVP - C++

                R Offline
                R Offline
                rich_wenger
                wrote on last edited by
                #10

                But you're not trying to help; you're trying to lecture. I'm looking for help. If you PC is slow copy the code to notepad, maybe that will help. I didn't assume anything about your job; I'm new to C-Sharp and asking for help databinding a control to a dataset. Do you have any exptertise in that area or not?

                C 1 Reply Last reply
                0
                • R rich_wenger

                  But you're not trying to help; you're trying to lecture. I'm looking for help. If you PC is slow copy the code to notepad, maybe that will help. I didn't assume anything about your job; I'm new to C-Sharp and asking for help databinding a control to a dataset. Do you have any exptertise in that area or not?

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #11

                  rich_wenger wrote: But you're not trying to help; you're trying to lecture. I'm looking for help. You want me to help, without pointing out the things you're doing wrong ? I'm trying both to give you advice as to why no-one has helped you ( your post showed all the signs of you giving the problem no thought yourself, it contains a lot of code that cannot be the problem, you don't bother to say where the problem is, or even exactly what it is ), and to work out what's going on so I can offer help. rich_wenger wrote: If you PC is slow copy the code to notepad, maybe that will help. I have a fast computer, but my network connection is slow. I copied the code to VS, as it happens, but it isn't enough to compile and run ( which would be the only reason for posting so much code ). The point is that some people read this site on 28.8, they are being forced to download all this pointless code every time they open this page, and people who read your post will almost all immediately disregard it because it is so long and obviously unfocused. rich_wenger wrote: I'm new to C-Sharp and asking for help databinding a control to a dataset. Well, it depends on the type of control, a combobox or listview needs to be told what columns to databind to, and you need to also select a table or view from the dataset to bind against. rich_wenger wrote: Do you have any exptertise in that area or not? If I didn't, I wouldn't have bothered answering at all. Christian Graus - Microsoft MVP - C++

                  R 1 Reply Last reply
                  0
                  • C Christian Graus

                    rich_wenger wrote: But you're not trying to help; you're trying to lecture. I'm looking for help. You want me to help, without pointing out the things you're doing wrong ? I'm trying both to give you advice as to why no-one has helped you ( your post showed all the signs of you giving the problem no thought yourself, it contains a lot of code that cannot be the problem, you don't bother to say where the problem is, or even exactly what it is ), and to work out what's going on so I can offer help. rich_wenger wrote: If you PC is slow copy the code to notepad, maybe that will help. I have a fast computer, but my network connection is slow. I copied the code to VS, as it happens, but it isn't enough to compile and run ( which would be the only reason for posting so much code ). The point is that some people read this site on 28.8, they are being forced to download all this pointless code every time they open this page, and people who read your post will almost all immediately disregard it because it is so long and obviously unfocused. rich_wenger wrote: I'm new to C-Sharp and asking for help databinding a control to a dataset. Well, it depends on the type of control, a combobox or listview needs to be told what columns to databind to, and you need to also select a table or view from the dataset to bind against. rich_wenger wrote: Do you have any exptertise in that area or not? If I didn't, I wouldn't have bothered answering at all. Christian Graus - Microsoft MVP - C++

                    R Offline
                    R Offline
                    rich_wenger
                    wrote on last edited by
                    #12

                    You don't.

                    C 1 Reply Last reply
                    0
                    • R rich_wenger

                      You don't.

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #13

                      I don't what ? Christian Graus - Microsoft MVP - C++

                      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