if so how?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I assume you're referring to the DataRowCollection.Contains method ? There is an overload that takes an array of objects, you should use this one
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 keyIn 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'Contains' does not seem to be a member of the DataRow class (maybe this is a typed data set?)
In any case, you can always use (DataTable.Select(....).Length > 0) as a substitute