asp.net.ph

DataView.Find Method ( Object )

System.Data Namespace   DataView Class


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

[ 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
The object to search for.

Return Value

The index of the row in the DataView containing the sort key value specified; otherwise a null value if the sort key value does not exist.

Example

The following example uses the Find method to return the index of the row containing the desired value in the primary key column.

private void FindValueInDataView ( DataTable tbl ) {
   DataView dv = New DataView ( tbl );
   dv.Sort = "CusomerID";
   // Find the customer named "Smith" in the primary key column
   int i = dv.Find ( "Smith" );
   Response.Write ( dv [ ] );
}
  C# VB

See Also

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