Link to home
Start Free TrialLog in
Avatar of nicksbell
nicksbell

asked on

treatment of duplicate records by sqldataadapter

I use sqldataadapter to add several records to a database.  Some, but not all, of those records may already be included in the source table and may contravene the primary key or unique index.  It seems that when I call sqldataadapter.update it will insert all records until it hits the first duplicate and then insert no more valid (non-duplicate) trades after that point.  What I want it to do is insert all records but ignore, or skip over, the duplicates.  What is the best way for me to achieve this.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Juan_Barrera
Juan_Barrera
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nick, now that I read Fernando's comment I see my error. Obviously it should be

da.ContinueUpdateOnError = True

Anyway, that's the property you should set.