views:

4696

answers:

7

I have an xsd, , vb, xsc, and xss file for a dataset in VS 2008 that I copied over from another VS project, however I need to make changes to the dataset. Thus I got into the xsd file, created new columns, deleted ones that aren't needed, etc., etc. However I realized when I attempted to use the new dataset I did not have the vb code behind the scenes. This code is typically found in dataset.designer.vb. When I copied the old one over of course it is no longer valid since columns have changed.

Any idea How I can force VS 2008 to use a xsd and to have it create/update its designer code?

THANKS

A: 

Unfortunately, this is in the gray area of things things that I can do when I need to, but I haven't needed to do enough to impart the knowledge to others.

All I know is that *.designer.vb means that this code was generated by visual studio, and if it generated it once it can do it again. Additionally, the very few times (maybe twice, both in vs2005) that I have done this it seemed like it was as simple as adding the *.xsd file to the solution explorer. If that alone doesn't do it try showing all files or right/double clicking on the *.xsd.

Joel Coehoorn
+1  A: 

THANKS for the help, in the end I JUST was able to get a dataset.vb file generated using the xsd.exe tool. It works for now, however, I still think something isn't set right in VS2008 or at least the "Generate Dataset" menu option from the context menu on an xsd file is gone.

I'll just need to remember that if i modify the xsd from here on out that VS isn't updating the vb file automatically, i'll probably get stuck with reusing the xsd.exe program.

For others the command is (using the MS VS 2008 Command Prompt Window Tool, in Admin mode if using vista)

xsd.exe /d /l:VB "XSD FILE LOCATION PATH"

/d says create dataset code /l is the language

and the .vb file will be created at: C:\Windows\System32

Enjoy

cd into the directory where you want the output first, then it will write it there instead of C:\Windows\System32.
Don
+1  A: 

You can right click the .xsd file and select 'Run Custom Tool' to regenerate the dataset.designer.vb file.

whatknott
If the 'Run Custom Tool' context menu item is missing, see @lambsland's answer below
Friend Of George
+1  A: 

you have just to exclude your xsd file and include it again, it will regenerated your designer.vb file.

like @lamsland's answer said... Click the .xsd file in Solution Explorer. Update the "Custom Tool" property to "MSDataSetGenerator".
Friend Of George
+1: this worked for me.
Brian MacKay
A: 

I want to create a dataset.xsd in vs2005, and I am using access database, so I cant know where my client save the application. Hence I used application.startuppath() to get the application folder and appended "Data\db.msd" to the application.startuppath() so i got the target location for the access databse in client machine. Now to create crystal reports I need the dataset.xsd but while creating a new dataset.xsd it was asking the path for the access database, how to programmatically specify the connection string in dataset.xsd so that i can create a connection string. and use that dataset for creating crystal reports.

Thanks in advance

ashok
+1  A: 

I don't know if this is still a common problem for others, but I did find an answer (I think). Click the .xsd file in Solution Explorer. Update the "Custom Tool" property to "MSDataSetGenerator". This will automatically regenerate the *.Designer.vb file.

lambsland
A: 

Hello,

Once the designer.vb is generated, it is possible to edit the generated dataset with the dataset designer ? (I mean, to edit it visually...)

Thanks !