asp.net.ph

DataView.Find Method ( Object [ ] )

System.Data Namespace   DataView Class


Finds a row in the DataView by the specified primary key values.

[ VB ]
Overloads Public Function Find ( _
   ByVal key ( ) As Object _
) As Integer

[ C# ]
public int Find (
   object [ ] key
);

[ C++ ]
public: int Find (
   Object* key [ ]
);

[ JScript ]
public function Find (
   key : Object [ ]
) : int;

Parameters

key
An array of values, typed as Object.

Return Value

The array of row indexes in the DataView containing the sort key values specified; otherwise a null value if the sort key values do not exist.

Example

The following example uses the Find 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";
   // Find the customer named "John Smith".
   int i = dv.Find ( vals );
   Response.Write ( dv [ ] );
}
  C# VB

See Also

DataView Members   DataView.Find 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