Finds a row in the DataView by the specified primary key values.
[Visual Basic] 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;
The index of the found row.
The following example uses the Find method to return the index of a row that contains specified values in its primary key columns.
[Visual Basic]
Private Sub FindValueInDataView(t As DataTable) Dim dv As DataView Dim i As Integer Dim vals(1) As Object dv = New DataView(t) dv.Sort = "Cusomers" ' Find the customer named "John Smith". vals(0)= "John" vals(1) = "Smith" i = dv.Find(vals) Console.WriteLine(dv(i)) End Sub
DataView Class | DataView Members | System.Data Namespace | DataView.Find Overload List