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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top