Finds a row in the DataView.
Finds a row in the DataView by the specified primary key value.
[Visual Basic] Overloads Public Function Find(Object) As Integer
[C#] public int Find(Object);
[C++] public: int Find(Object*);
[JScript] public function Find(Object) : int;
Finds a row in the DataView by the specified primary key values.
[Visual Basic] Overloads Public Function Find(Object()) As Integer
[C#] public int Find(Object[]);
[C++] public: int Find(Object*[]);
[JScript] public function Find(Object[]) : int;
The following example uses the Find method to return the index of a row that contains specified values in its primary key columns.
Note This example shows how to use one of the overloaded versions of Find. For other examples that may be available, see the individual overload topics.
[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