Last week Brendan Tompkins was complaining that the typed dataset generation process in .NET was not “open” enough. In my comemnt I said that typed dataset generation WAS extensible via CodeDOM manipulation (in all fairness to Brendan this is possibly not the easiest API to work with, but the extensibility hooks are there). I had a little demo application that I had written which did this, so I polished it up and put it on GotDotNet. It automatically generates typed datasets (or optionally Xml Schema files) for all the stored procedures in your MS SQL Server database using the same framework classes that xsd.exe uses (so it DOES actually serve some purpose as well as showing how to manipulate CodeDOM object graphs). In the past I have found typed datasets to be great, but keeping the stored procedure result-sets ,XML Schema and generated code synchronized was annoying. This utility removes that problem.
Comments
By being able to inherit from a typed dataset, you can put whatever validation or other custom behavior you want in your dataset.