davesil2 Posted May 5, 2004 Posted May 5, 2004 Hello, I've been programming in VB.Net for the last year. I am currently working with bound objects to a dataset. If I set the datasource of a combobox to a table in my dataset that shows up fine. However, if I create an index changed event for it the data appears to be invalid because my program crashes on loading. This also happens with radio buttons and such. I'm very confused as to why this is happening other than perhaps it is trying to change the index when binding the data where there is no data yet. I created all my own code (except for the form generated code). I use several functions due to re-occurance. the form load looks like this setupDA ' Setup the data adapters and sql commands filldatasets ' fill the dataset will data from the data adapters setbindings ' sets the bindings to the datasets My program doesn't even get to these before it crashes on the indexchanged event for the combobox... Please help :( Quote
Joe Mamma Posted May 5, 2004 Posted May 5, 2004 Hello, I've been programming in VB.Net for the last year. I am currently working with bound objects to a dataset. If I set the datasource of a combobox to a table in my dataset that shows up fine. However, if I create an index changed event for it the data appears to be invalid because my program crashes on loading. This also happens with radio buttons and such. I'm very confused as to why this is happening other than perhaps it is trying to change the index when binding the data where there is no data yet. I created all my own code (except for the form generated code). I use several functions due to re-occurance. the form load looks like this setupDA ' Setup the data adapters and sql commands filldatasets ' fill the dataset will data from the data adapters setbindings ' sets the bindings to the datasets My program doesn't even get to these before it crashes on the indexchanged event for the combobox... Please help :( hmmm. . . just guessing, but . . . is the code internal to the handler procedure wrapped in a "If Count > 0 then" clause? That might work. You might also want to do a similar boolean test to be sure the data is actually bound before the internals execute. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.