Create a Typed DataSet

Problem

You want to access table names and field values using strongly typed property names instead of field-name lookup.

Solution

Create a typed DataSet using Visual Studio .NET or the XSD.exe command-line utility.

Discussion

A strongly typed DataSet is actually a set of classes that inherit from the DataSet, DataTable, and DataRow classes. Although the basic DataSet can be used with any table structure, a strongly typed DataSet is designed for use with a specific set of tables. For example, you might create a strongly typed North-wind DataSet that includes a set of DataTable and DataRow classes customized for use with tables such as Products, Employees, Categories, Shippers, and so on. The strongly typed classes allow you to ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook 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.