5.4 Generating XML Schemas and Strongly Typed DataSets with XSD.exe
The .NET Framework SDK includes a tool named XSD.exe that can be used to speed up development when going from XML to code and from code to XML. The tool can automatically generate XML Schema Definition (XSD) files from XML or from classes and can also be used to generate strongly typed DataSets.
Tip
XSD is a W3C recommendation that defines a format for specifying the structure, semantics, and content of an XML file.
We’ll look at how to use XSD.exe to accomplish both of these tasks in this article.
| |
|---|---|
Tool | XSD.exe |
Version covered | 2.0 (.NET SDK) |
Home page | |
Power Tools page | |
Summary | Quickly and easily generate classes from schema and/or generate schema from classes |
License type | Microsoft EULA |
Online resources | Forums |
Supported Frameworks | .NET 1.1, 2.0 |
Related tools in this book | WSCF, XSDObjectGenerator |
Getting Started
XSD.exe is part of the .NET Framework, so you don’t need to do anything other than install a version of the .NET SDK to use it.
Using XSD
If you peek under the covers of a DataSet, you will find XML. This means that using XSD files as the basis for your data (and, more importantly, its structure) makes the creation of strongly typed DataSet objects rather simple. The best and easiest way to accomplish this is by first creating ...
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.
Read now
Unlock full access
