V
VB Programmer
I am adding a DataRow to a DataTable. The DataRow contains a guid (unique
identifier). This is used for replication. I tried adding the DataRow,
using the System.Guid.NewGuid method, but I get an error like this:
System.Data.ConstraintException: Column 'rowguid' is constrained to be
unique. Value 'xxxxx' is already present.
Here is my code:
Dim drNewRow As DataRow
drNewRow = dsInconData.Tables(0).NewRow
drNewRow(0) = 1
drNewRow(1) = Now
drNewRow(2) = 100
drNewRow(3) = System.Guid.NewGuid
dsInconData.Tables(0).Rows.Add(drNewRow)
daInconData.Update(dsInconData)
Any ideas?
Thanks,
Robert
identifier). This is used for replication. I tried adding the DataRow,
using the System.Guid.NewGuid method, but I get an error like this:
System.Data.ConstraintException: Column 'rowguid' is constrained to be
unique. Value 'xxxxx' is already present.
Here is my code:
Dim drNewRow As DataRow
drNewRow = dsInconData.Tables(0).NewRow
drNewRow(0) = 1
drNewRow(1) = Now
drNewRow(2) = 100
drNewRow(3) = System.Guid.NewGuid
dsInconData.Tables(0).Rows.Add(drNewRow)
daInconData.Update(dsInconData)
Any ideas?
Thanks,
Robert