DataRow.GetParentRow メソッド (String)
アセンブリ: System.Data (system.data.dll 内)

Dim instance As DataRow Dim relationName As String Dim returnValue As DataRow returnValue = instance.GetParentRow(relationName)
- relationName
DataRelation の RelationName。
現在の行の親 DataRow。


DataSet で、データ セットのすべての親 DataRelation オブジェクトのコレクションは、GetParentRows メソッドによって返されます。
DataTable は、ParentRelations プロパティが返す DataRelation オブジェクトのコレクションも格納します。

GetParentRow を使用して、DataTable 内の各 DataRow の各親行から値を出力する例を次に示します。
Private Sub GetParentRowForTable( _ thisTable As DataTable, relation As String) If thisTable Is Nothing Then Return End If ' For each row in the table, print column 1 ' of the parent DataRow. Dim parentRow As DataRow Dim row As DataRow For Each row In thisTable.Rows parentRow = row.GetParentRow(relation) Console.Write(ControlChars.Tab + " child row: " _ + row(1).ToString()) Console.Write(ControlChars.Tab + " parent row: " _ + parentRow(1).ToString() + ControlChars.Cr) Next row End Sub Private Sub CallGetParentRowForTable() ' An example of calling the function. Dim thisTable As DataTable = DataSet1.Tables("Products") Dim relation As DataRelation = thisTable.ParentRelations(0) GetParentRowForTable(thisTable, relation.RelationName) End Sub
private void GetParentRowForTable( DataTable thisTable, string relation) { if(thisTable ==null){return;} // For each row in the table, print column 1 // of the parent DataRow. DataRow parentRow; foreach(DataRow row in thisTable.Rows) { parentRow = row.GetParentRow(relation); Console.Write("\table child row: " + row[1]); Console.Write("\table parent row: " + parentRow[1]+ "\n"); } } private void CallGetParentRowForTable() { // An example of calling the function. DataTable thisTable = DataSet1.Tables["Products"]; DataRelation relation = thisTable.ParentRelations[0]; GetParentRowForTable(thisTable, relation.RelationName); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataRow.GetParentRow メソッド (DataRelation)
アセンブリ: System.Data (system.data.dll 内)

Dim instance As DataRow Dim relation As DataRelation Dim returnValue As DataRow returnValue = instance.GetParentRow(relation)
戻り値
現在の行の親 DataRow。


DataSet で、データ セットのすべての親 DataRelation オブジェクトのコレクションは、GetParentRows メソッドによって返されます。
DataTable は、ParentRelations プロパティが返す DataRelation オブジェクトのコレクションも格納します。

GetParentRow を使用して、DataTable 内の各子 DataRelation の子 DataRow オブジェクトを返す例を次に示します。次に、行の各列の値が出力されます。
Private Sub GetParentRowForTable _ (thisTable As DataTable, relation As DataRelation) If thisTable Is Nothing Then Return End If ' For each row in the table, print column 1 ' of the parent DataRow. Dim parentRow As DataRow Dim row As DataRow For Each row In thisTable.Rows parentRow = row.GetParentRow(relation) Console.Write(ControlChars.Tab & " child row: " _ & row(1).ToString()) Console.Write(ControlChars.Tab & " parent row: " _ & parentRow(1).ToString() & ControlChars.Cr) Next row End Sub Private Sub CallGetParentRowForTable() ' An example of calling the function. Dim thisTable As DataTable = DataSet1.Tables("Products") Dim relation As DataRelation = thisTable.ParentRelations(0) GetParentRowForTable(thisTable, relation) End Sub
private void GetParentRowForTable(DataTable thisTable, DataRelation relation) { if(thisTable ==null){return;} // For each row in the table, print column 1 // of the parent DataRow. DataRow parentRow; foreach(DataRow row in thisTable.Rows) { parentRow = row.GetParentRow(relation); Console.Write("\table child row: " + row[1]); Console.Write("\table parent row: " + parentRow[1]+ "\n"); } } private void CallGetParentRowForTable() { // An example of calling the function. DataTable thisTable = DataSet1.Tables["Products"]; DataRelation relation = thisTable.ParentRelations[0]; GetParentRowForTable(thisTable, relation); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataRow.GetParentRow メソッド (String, DataRowVersion)
アセンブリ: System.Data (system.data.dll 内)

Dim instance As DataRow Dim relationName As String Dim version As DataRowVersion Dim returnValue As DataRow returnValue = instance.GetParentRow(relationName, version)
- relationName
DataRelation の RelationName。
現在の行の親 DataRow。


DataSet で、データ セットのすべての親 DataRelation オブジェクトのコレクションは、GetParentRows メソッドによって返されます。
DataTable は、ParentRelations プロパティが返す DataRelation オブジェクトのコレクションも格納します。

GetParentRow を使用して、DataTable 内の各 DataRow の各親行から値を出力する例を次に示します。
Private Sub GetParentRowForTable _ (thisTable As DataTable, relation As String, _ version As DataRowVersion) If thisTable Is Nothing Then Return End If ' For each row in the table, print column 1 ' of the parent DataRow. Dim parentRow As DataRow Dim row As DataRow For Each row In thisTable.Rows parentRow = row.GetParentRow(relation, version) Console.Write(ControlChars.Tab & " child row: " _ & row(1).ToString()) Console.Write(ControlChars.Tab & " parent row: " _ & parentRow(1).ToString() & ControlChars.Cr) Next row End Sub Private Sub CallGetParentRowForTable() ' An example of calling the function. Dim thisTable As DataTable = DataSet1.Tables("Products") Dim relation As DataRelation = thisTable.ParentRelations(0) ' Print only original versions of parent rows. GetParentRowForTable(thisTable, relation.RelationName, _ DataRowVersion.Original) End Sub
private void GetParentRowForTable(DataTable thisTable, string relation, DataRowVersion version) { if(thisTable ==null){return;} // For each row in the table, print column 1 // of the parent DataRow. DataRow parentRow; foreach(DataRow row in thisTable.Rows) { parentRow = row.GetParentRow(relation, version); Console.Write("\t child row: " + row[1]); Console.Write("\t parent row: " + parentRow[1]+ "\n"); } } private void CallGetParentRowForTable() { // An example of calling the function. DataTable thisTable = DataSet1.Tables["Products"]; DataRelation relation = thisTable.ParentRelations[0]; // Print only original versions of parent rows. GetParentRowForTable(thisTable, relation.RelationName, DataRowVersion.Original); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataRow.GetParentRow メソッド (DataRelation, DataRowVersion)
アセンブリ: System.Data (system.data.dll 内)

Public Function GetParentRow ( _ relation As DataRelation, _ version As DataRowVersion _ ) As DataRow
Dim instance As DataRow Dim relation As DataRelation Dim version As DataRowVersion Dim returnValue As DataRow returnValue = instance.GetParentRow(relation, version)
戻り値
現在の行の親 DataRow。


DataSet で、データ セットのすべての親 DataRelation オブジェクトのコレクションは、GetParentRows メソッドによって返されます。
DataTable は、ParentRelations プロパティが返す DataRelation オブジェクトのコレクションも格納します。

GetParentRow を使用して、DataTable 内の各子 DataRelation の子 DataRow オブジェクトを返す例を次に示します。次に、行の各列の値が出力されます。
Private Sub GetParentRowForTable _ (thisTable As DataTable, relation As DataRelation, _ version As DataRowVersion) If thisTable Is Nothing Then Return End If ' For each row in the table, print column 1 ' of the parent DataRow. Dim parentRow As DataRow Dim row As DataRow For Each row In thisTable.Rows parentRow = row.GetParentRow(relation, version) Console.Write(ControlChars.Tab & " child row: " & _ row(1).ToString()) Console.Write(ControlChars.Tab & " parent row: " _ & parentRow(1).ToString() & ControlChars.Cr) Next row End Sub Private Sub CallGetParentRowForTable() ' An example of calling the function. Dim thisTable As DataTable = DataSet1.Tables("Products") Dim relation As DataRelation = thisTable.ParentRelations(0) ' Print only original versions of parent rows. GetParentRowForTable(thisTable, relation, _ DataRowVersion.Original) End Sub
private void GetParentRowForTable(DataTable thisTable, DataRelation relation, DataRowVersion version) { if(thisTable ==null){return;} // For each row in the table, print column 1 of the // parent DataRow. DataRow parentRow; foreach(DataRow row in thisTable.Rows) { parentRow = row.GetParentRow(relation, version); Console.Write("\table child row: " + row[1]); Console.Write("\table parent row: " + parentRow[1]+ "\n"); } } private void CallGetParentRowForTable() { // An example of calling the function. DataTable thisTable = DataSet1.Tables["Products"]; DataRelation relation = thisTable.ParentRelations[0]; // Print only original versions of parent rows. GetParentRowForTable(thisTable, relation, DataRowVersion.Original); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataRow.GetParentRow メソッド

名前 | 説明 |
---|---|
DataRow.GetParentRow (DataRelation) | 指定した DataRelation を使用して、DataRow の親行を取得します。 .NET Compact Framework によってサポートされています。 |
DataRow.GetParentRow (String) | DataRelation の指定した RelationName を使用して、DataRow の親行を取得します。 .NET Compact Framework によってサポートされています。 |
DataRow.GetParentRow (DataRelation, DataRowVersion) | 指定した DataRelation と DataRowVersion を使用して、DataRow の親行を取得します。 .NET Compact Framework によってサポートされています。 |
DataRow.GetParentRow (String, DataRowVersion) | DataRelation の指定した RelationName と DataRowVersion を使用して、DataRow の親行を取得します。 .NET Compact Framework によってサポートされています。 |

Weblioに収録されているすべての辞書からDataRow.GetParentRowを検索する場合は、下記のリンクをクリックしてください。

- DataRow.GetParentRowのページへのリンク