DataRelation

The DataRelation object represents a relationship between columns in a child table and columns in a parent table. Often there is a simple one-to-one mapping between the columns. For example, suppose the Customers table contains general customer information and the CustomerAddresses table contains the customers’ addresses (mailing address, billing address, shipping address, and so forth). A common CustomerId field links the two tables. In this example, the DataRelation contains references to the CustomerId fields in the two tables. The following code shows how a program might create this relation:

 customer_addresses_relation = New DataRelation( _ "Customers_Addresses", _ addresses_table.Columns("CustomerId"), _ customers_table.Columns("CustomerId")) ...

Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.