次の方法で共有


DataView.Find メソッド (Object)

指定した並べ替えキー値によって DataView 内の行を検索します。

Overloads Public Function Find( _
   ByVal key As Object _) As Integer
[C#]
public int Find(objectkey);
[C++]
public: int Find(Object* key);
[JScript]
public function Find(
   key : Object) : int;

パラメータ

  • key
    検索するオブジェクト。

戻り値

指定した並べ替えキー値が格納されている DataView 内の行のインデックス。指定した並べ替えキー値が存在しない場合は null 値。

使用例

[Visual Basic] Find メソッドを使用して、並べ替えキー列に必要な値が格納されている行のインデックスを返す例を次に示します。

 
Private Sub FindValueInDataView(t As DataTable)
   Dim dv As DataView
   Dim i As Integer
   dv = New DataView(t)
   dv.Sort = "CustomerID"
   ' Find the customer named "DUMON" in the primary key column
   i = dv.Find("DUMON")
   Console.WriteLine(dv(i))
End Sub

[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

DataView クラス | DataView メンバ | System.Data 名前空間 | DataView.Find オーバーロードの一覧 | Delete