System.ArgumentException: These columns don't currently have unique values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get the following error when attempting this code (not all the time mind you)

System.ArgumentException: These columns don't currently have unique values.

Dim keys2(2) As DataColumn
keys2(0) = ds.Tables("ORDER_DETAIL").Columns("ORDER_NO")
keys2(1) = ds.Tables("ORDER_DETAIL").Columns("ORDER_LINE_NO")
ds.Tables("ORDER_DETAIL").PrimaryKey = keys2


ORDER_DETAIL has a clustered key on ORDER_NO, ORDER_LINE_NO. I even have it loop through all the rows and print the order_no and order_line_no before this bit of code, there are no duplicates.

Any suggestions?
 
Back
Top