NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataView.Find (Object[])

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;

Parameters

key
An array of values, typed as Object.

Return Value

The index of the found row.

Example [Visual Basic]

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

See Also

DataView Class | DataView Members | System.Data Namespace | DataView.Find Overload List