Hi again.
My solution for setting primary key.
I already have a datatable so i cant create column to this. My code now look
like this:
//make a datatable to use row.find() or datatable.select method
DataTable dtCustCont = new DataTable("CustCont");
dtCustCont = customers.Tables[1];
// set primary keys.
DataColumn[] keys = new DataColumn[3];
DataColumn column;
column = new DataColumn();
column = dtCustCont.Columns["cc-custnr1"];
keys[0] = column;
column = new DataColumn();
column = dtCustCont.Columns["cc-custnr2"];
keys[1] = column;
column = new DataColumn();
column = dtCustCont.Columns["cc-class"];
keys[2] = column;
// Set the PrimaryKeys property to the array.
dtCustCont.PrimaryKey = keys;
I now have problme with the dtCustCont.Select(......) so that my main issue
right now :-)
Thanks
Lars E
"Lars E" <la***********@infocare.no> skrev i melding
news:uD**************@TK2MSFTNGP02.phx.gbl...
Hi all
How can i set primarykey to a datatable.
This datatable is in a dataset i get from a backend system.
My datatable contains several fields, and i want to make the fields
"c-custno1", "c-custno2" and "c-class" my primary key.
How can this be done?
Thanks
Lars E