forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource.vb
30 lines (21 loc) · 820 Bytes
/
source.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Option Explicit On
Option Strict On
Imports System.Data
Module Module1
Sub Main()
Dim customerOrders As New DataSet()
' <Snippet1>
Dim customerOrdersRelation As DataRelation = _
customerOrders.Relations.Add("CustOrders", _
customerOrders.Tables("Customers").Columns("CustomerID"), _
customerOrders.Tables("Orders").Columns("CustomerID"))
Dim custRow, orderRow As DataRow
For Each custRow In customerOrders.Tables("Customers").Rows
Console.WriteLine("Customer ID:" & custRow("CustomerID").ToString())
For Each orderRow In custRow.GetChildRows(customerOrdersRelation)
Console.WriteLine(orderRow("OrderID").ToString())
Next
Next
' </Snippet1>
End Sub
End Module