SQL Server 2000 Data Structure via ADO.Net

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hi,

I am trying to generate in XML the data structure of a SQL
Server 2000 database.
What I need is a means of programmatically generating a
comprehensive XML representation of the whole data
structure , relationships and all.
I want to do this through C#.

I have been using the following code : dataset.WriteXml
("c:\\mySchema.xml", XmlWriteMode.WriteSchema);This will
generate the structure but only at a simple level. For
example I only get the data type and maxlength of the
column and then for only one table.
I am aware that I can also get the
autoincremnt/datatype/unique etc values by calling
datacolumn.unique etc but this seems to be quite an
awkward way of getting things done.

Is this possible ? Any ideas.


Thanks,
Sean.
 
Hi Sean,

Dataset holds only minimal metadata that's why you can't use it for such
purposes.

Check out my announcement from yesterday:
ANN: Strong typed dataset schema generation template

It is a template that genertaes dataset's xsd data from database schema.

You can tweak it or build your own.



If you want to create the schema from your application directly you might
consider to use ADOX or OleDbConnecion.OleDbConnection.GetOleDbSchemaTable
method.
 
Hello Sean

There are several system stored procedures that will return the schema
information you need to reconstruct the database's schema. Open up Books On
Line and look them up. There are some very powerful options available there


--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx
 
Back
Top