Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concurrency Problem

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I had to have a list control where the user could make multiple selections. My boss requires the use of data binding so that seem to leave out a listbox etc.

The solution I ended up with is: I return a list of all potential items and a 1 if it already has been selected in the database, the item and a foreign key field - which is 0 on a new record.
I'm using typed datasets. This grid list is related to another table with the foreignkey value (which is not set for a new entry). When the user hits save the new record is inserted and the ID is passed back from the stored procedure causing a cascading change of the child tableadapter field. I have the value I need to go into the database. However, in calling the Update method I get an error that the concurrency violation: The Updatecommand affected 0 out of the expected 1 records.
It seems it doesn't like me changing the foreign key value. When I use an existing record, that value is present and the Update works fine. Does anyone have a suggestion for me here? Can I turn off concurrency detection or something??? Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top