A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.data.dataview.find below:

DataView.Find Method (System.Data) | Microsoft Learn

DataView.Find Method Definition

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

Overloads Find(Object[])
Source:
DataView.cs
Source:
DataView.cs
Source:
DataView.cs
Source:
DataView.cs

Finds a row in the DataView by the specified sort key values.

public:
 int Find(cli::array <System::Object ^> ^ key);
public int Find(object?[] key);
public int Find(object[] key);
member this.Find : obj[] -> int
Public Function Find (key As Object()) As Integer
Parameters Returns

The index of the position of the first row in the DataView that matches the sort key values specified; otherwise -1 if there are no matching sort key values.

Examples

The following Visual Basic example uses the Find method to return the index of a row that contains specified values in its sort key columns.

Private Sub FindValueInDataView(table As DataTable)
    Dim view As New DataView(table)
    view.Sort = "Customers"

    ' Find the customer named "John Smith".
    Dim vals(1) As Object
    vals(0)= "John"
    vals(1) = "Smith"
    Dim i As Integer = view.Find(vals)
    Console.WriteLine(view(i))
End Sub
See also Find(Object)
Source:
DataView.cs
Source:
DataView.cs
Source:
DataView.cs
Source:
DataView.cs

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

public:
 int Find(System::Object ^ key);
public int Find(object? key);
public int Find(object key);
member this.Find : obj -> int
Public Function Find (key As Object) As Integer
Parameters
key
Object

The object to search for.

Returns

The index of the row in the DataView that contains the sort key value specified; otherwise -1 if the sort key value does not exist.

Examples

The following Visual Basic example uses the Find method to return the index of the row that contains the value in the sort key column that you want.

Private Sub FindValueInDataView(table As DataTable)
    Dim view As New DataView(table)
    view.Sort = "CustomerID"

    ' Find the customer named "DUMON" in the primary key column
    Dim i As Integer = view.Find("DUMON")
    Console.WriteLine(view(i))
End Sub
See also

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4