How to create DB schema from XML schema

How to create DB schema from XML schema

Post by Neo » Sat, 22 Apr 2006 03:21:25


Hello All,

We have XSD file with XML schema and want to generate database or SQL
from it. Visual studio reads XSD file and shows everything graphically
fine. Is there anyway, we could actually transfer the graphical
information to database?


Best regards,
Neo
 
 
 

How to create DB schema from XML schema

Post by Steve Barn » Sat, 22 Apr 2006 21:09:22

I've only ever used the XSD file to create a strongly typed dataset. Do this
as follows:

Initially, you need to set-up the XSD utility...
In VS, Select Tools -> External Tools and press the Add button.
Give the new item a title of XSD.
Press the browse button to the right of the command line and browse to:
\Program files\Microsoft Visual Studio 8\SDK\V2.0\Bin\xsd.exe
Set the arguments to: /d $(ItemPath)
Set the initial dir to: $(ItemDir)
Ok the new tool. Once you've one this, you use xsd by:

a) Open the xsd document
b) Select Tools->XSD

This will take your xsd file and translate it in to C# code. The file name
is the same as the XSD file and the .cs file is written to the same folder
as the XSD file.

I know that XSD has other options... maybe one can do what you want...
perhaps you need to experiment.

Steve

 
 
 

How to create DB schema from XML schema

Post by Neo » Sat, 22 Apr 2006 22:02:31

but, how will database and tables be created from Dataset?
 
 
 

How to create DB schema from XML schema

Post by Steve Barn » Tue, 25 Apr 2006 17:13:42

You're just going to have to write code for that. The point is that the xsd
program gives you something you can easily include in a program that allows
you to create the database in code. There is no "automatic" translation
program that I know of.