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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bug with Data Form wizard

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
0
0
US
I used the Data Form wizard to create an updatable datagrid bound to a dataset. Whenever I try to insert a row, the grid inserts a duplicate row violating a primary key constraint. When I stepped through the code, I discovered the culprit was the following line of code from the method UpdateDataSet().
Code:
objdsPools.Merge(objDataSetChanges);
I commented out this line of code, and now the grid works fine. Does any one know why the wizard added that line of code or why the merge method is failing to recognize that the rows in objDataSetChanges already exists in objdsPools?

Also, I'm sure the wizard adds much more code than is necessary (messy code at that). All I want is a grid with insert, update, and delete functionality. Can anyone give me sample code to accomplish this that is simpler / less complicated than the code the wizard generates?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top