当前位置: 首页>>代码示例>>C#>>正文


C# DataRow.GetParentRow方法代码示例

本文整理汇总了C#中System.Data.DataRow.GetParentRow方法的典型用法代码示例。如果您正苦于以下问题:C# DataRow.GetParentRow方法的具体用法?C# DataRow.GetParentRow怎么用?C# DataRow.GetParentRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.DataRow的用法示例。


在下文中一共展示了DataRow.GetParentRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetParentRowForTable

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);
   }
开发者ID:.NET开发者,项目名称:System.Data,代码行数:22,代码来源:DataRow.GetParentRow

示例2: GetParentRowForTable

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);
   }
开发者ID:.NET开发者,项目名称:System.Data,代码行数:22,代码来源:DataRow.GetParentRow

示例3: GetParentRowForTable

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);
   }
开发者ID:.NET开发者,项目名称:System.Data,代码行数:25,代码来源:DataRow.GetParentRow

示例4: GetParentRowForTable

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);
   }
开发者ID:.NET开发者,项目名称:System.Data,代码行数:25,代码来源:DataRow.GetParentRow


注:本文中的System.Data.DataRow.GetParentRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。