|
-
December 31st, 2008, 12:15 PM
#1
Filling a DataTable by importing some rows from 2 other DataTables
I’m filling a DataTable ‘C’ by importing some rows from 2 other DataTables ‘A’ and ‘B’ with the same structure.
The problem is that there is a unique column ‘id’ defined in the table, so it happens that I am trying to import 2 rows with the same ‘id’ value, and of-course I get a
System.Data.ConstraintException saying "Column 'id' is constrained to be unique. Value '0' is already present."
Is there a way to avoid this?
I can create a new row in table ‘C’ and copy each column’s value from the other table’s row, except the value of the unique column, but I wanted to use ImportRow to avoid this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|