i want to setup a primary key without using the datacolumn class, what i tryd is...
DataSet ds;
ds.Tables["Customer"].PrimaryKey = ds.Tables["Customer"].Columns["CustID"]
then i get error that i cannot implicitly convert type system.data.datacolumn[] to system.data.datacolumn
2 replies to this topic
#1
Posted 10 September 2010 - 07:46 AM
|
|
|
#2
Posted 11 September 2010 - 02:12 AM
How about the following?
DataColumn[] pk= new DataColumn[1]; pk[0] = ds.Tables["Customer"].Columns["CustID"]; ds.Tables["Customer"].PrimaryKey = pk;
#3
Posted 17 September 2010 - 11:01 AM
thanks, i got the answer by using the missingSchemaAction i did not want use the dataColum
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









