Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Newbie: creating DB tables from XML. [Thread Next] Re: Newbie: creating DB tables from XML.To: NULL Date: 4/2/2007 11:46:00 AM Hello, You xan use XMLBulkload component (http://msdn2.microsoft.com/en-us/library/ms171993.aspx) and use the SchemaGen property to generate the DB tables. I hope this helps. Regards, -- Monica Frintu "Bruce Wood" wrote: > On Mar 24, 3:40 am, "BLUE" <blue> wrote: > > Using Visual C# 2005, how can I programmatically create physical tables in a > > DBMS from an XML schema or an XML file? > > The only way is manually parsing the file to generate the "CREATE TABLE" SQL > > statement? > > Use ADO.NET to read the XML into an ADO DataSet. If the XML has an XML > Schema, then you can use that to first create the table(s) in the > DataSet with all of the columns having appropriate types.* > > Then use the ADO DataSet to create tables in the DBMS. > > * If you don't have a schema, your biggest problem will be determining > the types of the data columns. For example, if an XML attribute says > code="50234", is that an alphanumeric field, or an integer? How big > can it get? etc. The XML Schema could give you answers to these > questions, allow ADO.NET to create data columns with the correct > types, and make the job of creating the tables in the DBMS much > simpler. Without the schema, you might be forced to make every column > a varying length string column. > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
