Creating DataRelation Objects in Microsoft Visual Studio

Now that you understand the major features of the DataRelation class, let’s see how to create DataRelation objects in Visual Studio.

Adding a DataRelation to a Strongly Typed DataSet

We’ll discuss strongly typed DataSets in Chapter 9. If you’ve worked with them in prior versions of Visual Studio, you’ll be pleased to learn that the designer now queries SQL Server for foreign key information to automatically create DataRelations when related tables are included in a strongly typed DataSet.

Adding a DataRelation to an Untyped DataSet

You can also add DataRelation objects to untyped DataSet objects. In the previous chapter, you learned how to add an untyped DataSet to a designer, such as a Windows ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition 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.