table does not have primary key error in vb.net

  • Thread starter Thread starter siddharth
  • Start date Start date
S

siddharth

when i am finding a particular row in a database through a
datatable.row.find(the particular text to find) it gives me table does
not have primary key
although it has a primary key
 
Hi,

A primary key doesnt transfer automatically from a database to a
datatable. You need to add it manually.

dsClient.Tables(0).PrimaryKey = New DataColumn()
{dsClient.Tables(0).Columns("ID")}

Ken
 

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