简体   繁体   中英

How to create a dataset from an xsd schema in Visual studio 2010

I searched for this here and on msdn but didn't find a satisfactory answer either because things changed from 2005/2008 to 2010 or I don't know how to use VS IDE. So, here is what I am trying to I have an xsd file and I want to perform searching operations on that. For that I figured that I would need corresponding classes and dataset is the way to go. I created a dataset from file system(don't want to make it complex) and trying to link the schema and xsd that I have. I also read that there is a way to create a class(ORM) such that whenever I make changes to the schema the class is also updated.

Links to MSDN articles that I read: http://msdn.microsoft.com/en-us/library/yk6y3s8y.aspx

http://msdn.microsoft.com/en-us/library/aa720235.aspx

Yes XSD.exe will generate (among other things) a C# class and/or a dataset for a given schema (use the /c switch for generating classes and /d for generating a dataset).

If you are using VS.net 2008 (and perhaps VS.net 2010; I dont have 2010), you can right click on your project and select "Add new item" - select the Dataset template and the IDE will automatically generate the class files for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM