Khaledinho Posted June 26, 2005 Posted June 26, 2005 (edited) 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??SimpleDatabaseApplication.zip Edited June 26, 2005 by PlausiblyDamp Quote Life is the biggest school
Khaledinho Posted July 7, 2005 Author Posted July 7, 2005 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 Quote Life is the biggest school
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.