Can you use DataTable.Contains(object key) if your datatable's primary key is two columns?
14,390
To select by a primary key you should use one of:
DataTable.Rows.Find(Object)
in case your PK is one columnDataTable.Rows.Find(Object[])
in case you have more then 1 column as a primary key
In case of a typed DataSet, the method MyDataTable.Rows.Find(...)
will be generated for you with the proper signature. Basically it is a method on DataRowCollection class
Author by
Slim
Updated on June 24, 2022Comments
-
Slim almost 2 years
if so how?