Generate Typed Dataset from an XSD file in Visual Studio 2005
![]()
Typed DataSets in ASP.NET is a pretty nice and handy feature. It gives you greater control of what the table relations should be and it pretty much reflect what the database holds. It’s pretty nice. But one thing I hate about Typed DataSet is that when you serialize your Typed DataSet your XML looks little messed up.
For the most part the XML serves the purpose but it has all sorts of primary key/foreign key references that are serialized into the XML that at times we might not need and might be confusing. Rather if we can get an XML that makes more sense and readable would suffice.
Adding an XSD file to your project won’t help right away as Visual Studio.NET 2005 doesn’t directly generate datasets (.Designer.cs files) out of it. But, there is a work around that you can use to make Visual Studio.NET 2005 generate typed-dataset from an XSD files. Here is what you should do,

- Select the XSD file you want Visual Studio.NET 2005 to generate typed-dataset from
- Right click and choose “Properties” to go into the XSD file’s Properties list
- Set the “Build Action” to “Content”
- Set the “Custom Tool” to point to “MSDataSetGenerator”
And that’s it. The next time you save the XSD file in Visual Studio.NET 2005 you should be able to see the dataset file, .Designer.cs (or .vb) file, that’s more meaningful to read.


