asp.net.ph

DataView.FindRows Method ( Object [ ] )

System.Data Namespace   DataView Class


Returns an array of DataRowView objects whose columns match the specified sort key values.

[ VB ]
Overloads Public Function FindRows ( _
   ByVal key ( ) As Object _
) As DataRowView ( )

[ C# ]
public DataRowView [ ] FindRows (
   object [ ] key
);

[ C++ ]
public: DataRowView [ ] FindRows (
   Object* key [ ]
);

[ JScript ]
public function FindRows (
   key : Object [ ]
) : DataRowView [ ];

Parameters

key
An array of column values, typed as Object, to search for.

Return Value

An array of DataRowView objects whose columns match the specified sort key values; or, if no rows contain the specified sort key values, an empty DataRowView array.

Example

The following example uses the FindRows method to return the index of a row that contains specified values in its primary key columns.

private void FindValueInDataView ( DataTable tbl ) {
   DataView dv = New DataView ( tbl );
   dv.Sort = "Cusomers";
   Object [ ] vals;
   vals [ 0 ] = "John";
   vals [ 1 ] = "Smith";
   // FindRows the customer named "John Smith".
   DataRowView i = dv.FindRows ( vals );
   Response.Write ( dv [ ] );
}
  C# VB

See Also

DataView Members   DataView.FindRows Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph