Hi,
I have some questions regarding to use vs.net to generate xsd from database tables then generate classes, not typed datasets, from the xsd.
Basically I want to have some light-weigh classes to represent the database tables/views (I know tables/view are not business entities, but this is a good starting point and i am lazy =) Here are what I did:
- used xsd.exe to generate business entities, which will be used to be passed between layers, based on the xsd files.
- created the xsd file by creating an new XML schema item, then dragging the tables from server explorer then dropping to the vs.net designer.
- I don't need typed datasets for these business entities, I only need simple classes to represent the business entities so I use the /classes switch when running the xsd and I create an external tool entry for xsd.exe by passing the ItemFileName and ItemExt as arguments to automate this process.
Here are my questions:
1. vs.net designer always creates document root when I drag&drop the tables into designer. Is there any way that I can exclude the root document from being generated as a class? Is there any way the change this behavior of vs.net designer?
2. vs.net appends the parent node name to the subnodes. Is there a way to change this behavior?
3. xsd.exe appends the root document as prefix to all the classes associated with. How can I prevent xsd.exe appending the prefix to the generated classes?
4. is there a detail article about how to create class from xsd using xsd.exe and vs.net designer?
5. I understand codegen annotations can be used for generating typed dataset, any thing i can do use annotation
thanks in advance
ILN