NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataTable.FindRows (DataKey, Object[])

Finds and returns an array of DataRow objects using the specified DataKey and values.

[Visual Basic]
Overloads Protected Function FindRows( _
   ByVal key As DataKey, _
   ByVal values() As Object _
) As DataRow ()
[C#]
protected DataRow[] FindRows(
   DataKey key,
   object[] values
);
[C++]
protected: DataRow* FindRows(
   DataKey* key,
   Object* values[]
) [];
[JScript]
protected function FindRows(
   key : DataKey,
   values : Object[]
) : DataRow[];

Parameters

key
A DataKey that specifies the DataColumn objects which comprise the tables primary key or keys.
values
[To be supplied.]

Return Value

A DataRow that contains the specified values.

Example [Visual Basic]

The following example sets the DataKey to the columns of a DataTable, and returns an array of DataRow objects that contain the specified values.

[Visual Basic]

Private Sub FindInDataKey()
   Dim keyCols() As DataColumn
   Dim t As DataTable
   t = DataGrid1.DataSource
   keyCols = t.PrimaryKey
   Dim arrVals(1) As Object
   ' Search for two values, the first is an index, the second a date.
   arrVals(0) = 1
   arrVals(1) = "12/2/99"
   Dim foundCols() As DataColumn
   foundCols = t.FindRows(keyCols, arrVals)
End Sub

See Also

DataTable Class | DataTable Members | System.Data Namespace | DataTable.FindRows Overload List | Select