Trying to generate a Dataset from XSD file in VS 2005

Posted on 2008-01-31
Medium Priority
Last Modified: 2010-08-05
I have a VB.NET project.  In this project I have a schema.xsd file.  I would like to generate a .cs file to go with the .xsd file.  I've found here on EE and other places talk about right clicking on the xsd window and selecting "Generate Dataset".  In VS 2005 when I right click I get all of the other options that I've seen in pictures but I don't get the "Generate Dataset" option (I don't get the Auto Arrange option either).  If I select the Schema menu at the top I see the same options.  Again, Generate dataset is missing.

The descriptions I've seen where this is on the menu are talking about VS 2003.  In VS 2005 Professional I'm not seeing that option.  Is there something in the options I need to check to make this show up or has it been moved somewhere else?  I guess they could have just removed the functionality as well but I would hope not.

Any ideas anyone?

Question by:mlazear
  • 3
  • 2

Author Comment

ID: 20793167
I found an article that describes how to do what I want using the VS Command Prompt:

However, I still would like to find out why this doesn't show on my menu.

Accepted Solution

xPert_Umer earned 1000 total points
ID: 20794465
1. just add new item DataSet....
2. on the designer, select your datasource (Server Explorer-> Data Connections)
(or, use items on the Toolbox there are items like TableAdapter, DataTable, Query)
3. and drag and drop your datasource(table, sp,...) on the designer..
4. to configure more, chose Data menu--> configure
(or context menu--> configure)

first time it was little bit un-familiar, but after couple of times pratice it gets better results and easier configuration practice than vs2003

Expert Comment

ID: 20794470
StiReport report = new StiReport();
DataSet dataSet = new DataSet("Test");

Dim Report As StiReport = New StiReport()
Dim Data As DataSet = New DataSet("Test")
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

LVL 12

Assisted Solution

vb_jonas earned 1000 total points
ID: 20794527
Here's how to generate it from within VS2005:

Select the XSD file you want VSNET 2005 to generate typed-dataset from
Go into the XSD files properties
Set the Build Action to Content 
Set the Custom Tool to point to MSDataSetGenerator 
The next time you save the XSD file you should be able to see the dataset file, .Designer.cs (or .vb) file, for your XSD.


Author Closing Comment

ID: 31426977
I split the points between the two of you.  vb_jonas answer was exactly what I was asking but I like having multiple ways to do things and xp_umer added interesting information with the programmitical way of doing it.


Author Comment

ID: 20800087
Thanks for the help!

I should explain a bit more of what I'm trying to do.  I've created an XSD file which is the definition of an XML file that I'm going to write out to disk.  It won't be stored in any form of a database other than a simple XML text file.

xPert Umer:
I tried the steps you suggested but I get lost.  I can add a new DataSet and I see the options that you describe (TableAdapter, Query, ...) but I'm not sure what I'm supposed to be dragging onto the Designer.  The XML file is my data source and it doesn't yet exist because I'm trying to create the code from my XSD file in order to create the XML file.  Data menu, Configure is grayed out but that is probably because I haven't dragged a datasource on to the Designer yet.

Will your methodology work when all I have is an XSD file that I've created using the Designer (the Designer that shows a toolbox labeled "XML Schema") ?

Thanks for the code in your second post that might be very useful as well.

The steps worked but my .vb file did not show up.  In order to make it show up you have to go to Project, Show All Files.  Then the Schema.xsd file shows a plus in the Solutions window that can be clicked on.  When you click on it you then see "Schema.Designer.vb" and a couple other files.


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
SingleRun is a tool that ensures that only one instance of an application is started, running it again brings the application to focus.
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question