|
I'm trying to write something that will generate the equivalent of what the MSDataSetGenerator produces with some extensions that I need. My plan was to try to invoke the MSDataSetGenerator, get the codedom output back and add what I needed to that. Since I've not been able to figure out how to invoke the MSDataSetGenerator from my code I went looking at the System.Data.Design.TypedDataSetGenerator.Generate method. Once I figured out how to get that to run with my xsd file as input I found that it was close...but not quite what I needed.
If you run the MSDataSetGenerator it produces 2 namespaces.
If you set the Namespace name on the data set to (for example) "test", the MSDataSetGenerator produces
namespace test { public partial class <DatSetName> : System.Data.DataSet { } }
and
namespace test.DataAccessTableAdapters { }
If I run the TypedDataSetGenerator.Generate method passing the same namespace name ("test" in this case) all I get is the code in the test.DataAccessTableAdapters section.
So, my question is, what is used to generate the System.Data.Data set code. I looked at Xsd.exe and tried to use the /dataset option but what I get when running that from the command line is an error that Error: There was an error processing 'DataAccess.xsd'. - Error generating code for DataSet ''. - Failed to generate code. Failed to find or load the registered .Net Framework Data Provider. - Failed to find or load the registered .Net Framework Data Provider.
and I'm not sure how to pass the assembly for the data provider..if there is a way.
In any case, any pointers would be appreciated.
Thanks
|