vipinkrshamra
Programmer
I am using adapter.update method to insert a datatable. One of the field in database table to which datatable ois referring is UNIQUE key.
here is complete error message :
Error : Violation of UNIQUE KEY constraint 'IX_tblJunk'. Cannot insert duplicate key in object 'tblJunk'.
The statement has been terminated.
I am using follwing command to update data :
da.ContinueUpdateOnError = True
da.Update(ds, TableName)
I am using ContinueUpdateOnError becasue I want to insert records irrespective of errros. After dataadapter.update command I am using ds.Tables(TableName).HasErrors to browse through the errors. I am getting UNIQUE KEY constraint error for records which are actually not there in database for example I am gettign error for row which has indexfield as "abcd" but if search database for "abcd" record it is not there.
I can not manually search or minimise number of insertion records to troubleshoot this issue.
Any help would be greatly apprecriated.
here is complete error message :
Error : Violation of UNIQUE KEY constraint 'IX_tblJunk'. Cannot insert duplicate key in object 'tblJunk'.
The statement has been terminated.
I am using follwing command to update data :
da.ContinueUpdateOnError = True
da.Update(ds, TableName)
I am using ContinueUpdateOnError becasue I want to insert records irrespective of errros. After dataadapter.update command I am using ds.Tables(TableName).HasErrors to browse through the errors. I am getting UNIQUE KEY constraint error for records which are actually not there in database for example I am gettign error for row which has indexfield as "abcd" but if search database for "abcd" record it is not there.
I can not manually search or minimise number of insertion records to troubleshoot this issue.
Any help would be greatly apprecriated.