Adding PrimaryKey to a DataTable

S

Shawn

Hi.
This is my problem. I'm filling a DataTable with data from my DB. The
problem is that none of the data is unique, not even combined. So I was
wondering if it is possible to add a unique column (AutoIncrement) to the
DataTable after (or before) I fill it with data?

Thanks,
Shawn
 
E

Eliyahu Goldin

Shawn,

You can always do it in the code after populating the table from the
database. Reserve a column for the index and, after you got the data, loop
through the rows and set the index column value.

Eliyahu
 

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

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top