.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Articles >> .Net Framework >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Using the .NET Framework Utility with DataSet

Posted By:Shashi Ray       Posted Date: November 29, 2009    Points: 25    Category: .Net Framework    URL: http://www.dotnetspark.com  


Using the .NET Framework Utility

The .NET Framework SDK includes a command-line utility called the XML Schema Definition Tool that helps you generate class files based on XML schema (.xsd) files. Use this utility in conjunction with the DataSet object's WriteXmlSchema method to translate your untyped DataSet into a strongly typed DataSet.

The following command illustrates how to generate a class file from an XML schema file. Open a Command window and type:

C:\>xsd MyNewClass.xsd /d

The first parameter in the command is the path to the XML schema file. The second parameter indicates that the class you want to create is derived from the DataSet class. By default, the tool generates Visual C# .NET class files, but it can also generate Visual Basic .NET class files by adding the appropriate options. To list the tool's available options, type:

xsd /?


Once you've created your new class file, add it to your project. You can now create an instance of your strongly typed DataSet class, as shown in the following Visual C# .NET code snippet:

MyNewClass ds = new MyNewClass();



Shashi Ray

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend