本文整理匯總了VB.NET中System.Data.DataRelation.DataRelation構造函數的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataRelation構造函數的具體用法?VB.NET DataRelation怎麽用?VB.NET DataRelation使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Data.DataRelation
的用法示例。
在下文中一共展示了DataRelation構造函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: CreateRelation
Private Sub CreateRelation()
' Code to get the DataSet not shown here.
' Get the DataColumn objects from two DataTable
' objects in a DataSet.
Dim parentCols As DataColumn() = _
{DataSet1.Tables("Customers").Columns("CustID"), _
DataSet1.Tables("Customers").Columns("OrdID")}
Dim childCols As DataColumn() = _
{DataSet1.Tables("Orders").Columns("CustID"), _
DataSet1.Tables("Orders").Columns("OrdID")}
' Create DataRelation.
Dim CustOrderRel As New DataRelation( _
"CustomersOrders", parentCols, childCols)
' Add the relation to the DataSet.
DataSet1.Relations.Add(CustOrderRel)
End Sub
示例2: CreateRelation
Private Sub CreateRelation()
' Code to get the DataSet not shown here.
' Get the DataColumn objects from two DataTable
' objects in a DataSet.
Dim parentColumns() As DataColumn
Dim childColumns() As DataColumn
parentColumns(0) = DataSet1.Tables( _
"Customers").Columns("CustID")
parentColumns(1) = DataSet1.Tables( _
"Customers").Columns("OrdID")
childColumns(0) = DataSet1.Tables( _
"Orders").Columns("CustID")
childColumns(1) = DataSet1.Tables( _
"Orders").Columns("OrdID")
' Create DataRelation.
Dim CustOrderRel As New DataRelation( _
"CustomersOrders", parentColumns, childColumns)
' Add the relation to the DataSet.
DataSet1.Relations.Add(CustOrderRel)
End Sub
示例3: CreateRelation
Private Sub CreateRelation()
' Code to get the DataSet not shown here.
' Get the DataColumn objects from two DataTable
' objects in a DataSet.
Dim parentColumn As DataColumn = DataSet1.Tables( _
"Customers").Columns("CustID")
Dim childColumn As DataColumn = _
DataSet1.Tables("Orders").Columns("CustID")
' Create DataRelation.
Dim bConstraints As Boolean = True
Dim customerOrdersRelation As DataRelation = _
New DataRelation("CustomersOrders", _
parentColumn, childColumn, bConstraints)
' Add the relation to the DataSet.
DataSet1.Relations.Add(customerOrdersRelation)
End Sub
示例4: CreateRelation
Private Sub CreateRelation()
' Code to get the DataSet not shown here.
' Get the DataColumn objects from two DataTable
' objects in a DataSet.
Dim parentColumns() As DataColumn
Dim childColumns() As DataColumn
parentColumns(0) = DataSet1.Tables( _
"Customers").Columns("CustID")
parentColumns(1) = DataSet1.Tables( _
"Customers").Columns("OrdID")
childColumns(0) = DataSet1.Tables( _
"Orders").Columns("CustID")
childColumns(1) = DataSet1.Tables( _
"Orders").Columns("OrdID")
Dim bConstraints As Boolean = True
' Create DataRelation.
Dim CustOrderRel As New DataRelation( _
"CustomersOrders", parentColumns, childColumns, _
bConstraints)
' Add the relation to the DataSet.
DataSet1.Relations.Add(CustOrderRel)
End Sub