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[];
A DataRow that contains the specified values.
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
DataTable Class | DataTable Members | System.Data Namespace | DataTable.FindRows Overload List | Select