Skip to Main Content
VB.Net Web Developer's Guide
book

VB.Net Web Developer's Guide

by Syngress
September 2001
Intermediate to advanced content levelIntermediate to advanced
608 pages
23h 46m
English
Syngress
Content preview from VB.Net Web Developer's Guide
Using ADO.NET • Chapter 9 429
one set of data, for every row in the OrderDetails record, we had all the Order
record information as well.This required some ugly code to get the parent-child
relationship in front of the end user.
To set up a DataRelation, we need two DataTable objects in our DataSet: a
Primary key and a Foreign key.These will establish our Parent objects and our
Child objects. For example:
Dim myds As DataSet = New DataSet("Orders")
Dim MyCol() As DataColumn
Add a Primary key to the DataTable to define the parent in the relationship:
MyCol(0) = myds.Tables("Orders").Columns("OrderID")
myds.Tables("Orders").PrimaryKey = MyCol
Add the relation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VB.NET Core Classes in a Nutshell

VB.NET Core Classes in a Nutshell

Budi Kurniawan, Ted Neward

Publisher Resources

ISBN: 9781928994480