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().
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?
Code:
objdsPools.Merge(objDataSetChanges);
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?