assigning primary key to more than one column

G

gaffar

Sir,

if we want to assign a primary key to a single cloumn. below code is used.

objTable1.Keys.Append("PrimaryKey", KeyTypeEnum.adKeyPrimary,
"PrimaryKey_Field")

if i want to assign primary to more than one column then what will be code.
 
K

Ken Tucker [MVP]

Hi,

Try something like this.
dsClient.Tables(0).PrimaryKey = New DataColumn()
{dsClient.Tables(0).Columns("FirstName"),
dsClient.Tables(0).Columns("LastName")}



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

Top