次の方法で共有


DataRow.GetParentRows メソッド (String, DataRowVersion)

DataRelation の指定した RelationNameDataRowVersion を使用して、 DataRow の親行を取得します。

Overloads Public Function GetParentRows( _
   ByVal relationName As String, _   ByVal version As DataRowVersion _) As DataRow()
[C#]
public DataRow[] GetParentRows(stringrelationName,DataRowVersionversion);
[C++]
public: DataRow* GetParentRows(String* relationName,DataRowVersionversion) [];
[JScript]
public function GetParentRows(
   relationName : String,version : DataRowVersion) : DataRow[];

パラメータ

  • relationName
    DataRelationRelationName
  • version
    取得するデータのバージョンを指定する DataRowVersion 値の 1 つ。可能な値は、Default、Original、Current、および Proposed です。

戻り値

DataRow オブジェクトの配列 (または長さ 0 の配列)。

例外

例外の種類 条件
ArgumentException リレーションシップと行が同じテーブルに属していません。
ArgumentNullException relation が null 参照 (Visual Basic では Nothing) です。
RowNotInTableException 行がこのテーブルに属していません。
VersionNotFoundException 要求された DataRowVersion が行にありません。

解説

DataSet で、データ セットのすべての親 DataRelation オブジェクトのコレクションは、 GetParentRows メソッドによって返されます。

DataTable は、 ParentRelations プロパティが返す DataRelation オブジェクトのコレクションも格納します。目的の DataRowVersion が存在するかどうかを確認するには、 HasVersion プロパティを使用します。

必要条件

プラットフォーム: 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

参照

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