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
 
Back
Top