Creating Strongly Typed DataSet Objects

So how do you create a strongly typed DataSet class? You can choose one of two basic approaches. One involves writing code and using a command-line tool that’s part of the .NET Framework SDK. The other approach, which is much simpler, relies on the Visual Studio development environment and doesn’t require you to open a Command window.

The Hard Way

The .NET Framework SDK includes a command-line utility called the XML Schema Definition Tool, which helps you generate class files based on XML schema (.xsd) files. You can use this utility in conjunction with the DataSet class’s WriteXmlSchema method to translate your DataSet into a strongly typed DataSet class.

Using the DataSet Class’s WriteXmlSchema Method

Later ...

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.