DataAdapter Update Problem

Khaledinho

Active member
Joined
Jun 22, 2005
Messages
25
Hi
I am developing an ADO.NET Application that binds a hypothetical school database to the user interface.All tables contain primary keys.In the interface the user may add new records.I used my own logic to create a unique primary key.
Note:After the error occured(I bound the primary key to a text box and entered it manually with each new added record to make sure it is uniqe)and all the other feilds in the table are (fname,sname...etc)
When Use the DataAdapter.Update() method i get the following exception
System.Data.OleDBException:The changes you requested to the table were not successful because they would create duplicate values in the index,primary key,or relationship

This is very strage??
 

Attachments

Last edited by a moderator:
Magadass said:
set Unique Constraint to false
Hi
This will not solve the problem
I discovered that the column takes the default value from the access file
So,whatever rows I add, they will take the same value, which is the default value of the column determined by the access database.

Using autonumber will solve the problem when adding new row and updating and even deleting,but it will cause big problems with relations between tables
 
Back
Top