asp.net.ph

DataRowCollection.Find Method ( Object )

System.Data Namespace   DataRowCollection Class


Returns the row specified by the primary key value.

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

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

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

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

Parameters

key
The primary key value of the DataRow to find.

Return Value

A DataRow containing the primary key value specified; otherwise a null value if the primary key value does not exist in the DataRowCollection.

Remarks

To use the Find method, the DataTable object to which the DataRowCollection object belongs to must have at least one column designated as a primary key column. See the PrimaryKey property for details on creating a primary key column.

Example

The following example uses the Find method to find the specified primary key value in a collection of DataRow objects.

DataRow thisRow = myRows.Find ( empToDelete );
  C# VB

 Show me 

See Also

DataRowCollection Members   DataRowCollection.Find Overload List   DataTable   PrimaryKey   Contains 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