473,803 Members | 3,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automagically create database schema from XML dataset

Hello.

I am trying to create a database from an XML file. I am able to create a dataset from the XML doc, but how can I create a database schema from the dataset and populate the database? Or is this even possible using VS.NET 2003?

Part of the XML file follows. Thanks for any help.

Steven
VS.NET 2003 and C# newbie!

----- Part of the XML (one full record across several tables) --------

<!DOCTYPE PubmedArticleSe t...>
- <PubmedArticleS et>
- <PubmedArticl e>
- <MedlineCitatio n Owner="NLM" Status="Complet ed"><PMID>11604 973</PMID>
- <DateCreated><Y ear>2001</Year><Month>10</Month><Day>17</Day></DateCreated>
- <DateCompleted> <Year>2002</Year><Month>02</Month><Day>14</Day></DateCompleted>
- <Article>
- <Journal><ISSN> 1569-6332</ISSN>
- <JournalIssue PrintYN="Y"><Vo lume>10</Volume><Issue>P t 2</Issue>
- <PubDate><Year> 2001</Year></PubDate></JournalIssue></Journal><Articl eTitle>Personal health information-seeking: a qualitative review of the literature.</ArticleTitle>
- <Pagination><Me dlinePgn>1484-8</MedlinePgn></Pagination>
- <Abstract><Abst ractText>This ...</AbstractText></Abstract><Affil iation>Division of Biomedical Informatics and Outcomes Research, Oregon Health Sciences University, Portland, OR, USA. zs*****@therive r.com</Affiliation>
- <AuthorList CompleteYN="Y">
- <Author><LastNa me>Stavri</LastName><ForeN ame>P Z</ForeName><Initi als>PZ</Initials></Author></AuthorList><Lan guage>eng</Language>
- <PublicationTyp eList><Publicat ionType>Journal Article</PublicationType ><PublicationTy pe>Review</PublicationType ><PublicationTy pe>Review Literature</PublicationType ></PublicationType List></Article>
- <MedlineJournal Info><Country>N etherlands</Country><Medlin eTA>Medinfo</MedlineTA><NlmU niqueID>7600347 </NlmUniqueID></MedlineJournalI nfo><CitationSu bset>IM</CitationSubset>
- <MeshHeadingLis t>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Health Education</DescriptorName> <QualifierNam e MajorTopicYN="Y ">utilizati on</QualifierName></MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Health Services Accessibility</DescriptorName> </MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Health Services Needs and Demand</DescriptorName> </MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Human</DescriptorName> </MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Informati on Services</DescriptorName> <QualifierNam e MajorTopicYN="Y ">utilizati on</QualifierName></MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="Y ">Patient Acceptance of Health Care</DescriptorName> </MeshHeading>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Patient Participation</DescriptorName> </MeshHeading></MeshHeadingList ><NumberOfRefer ences>63</NumberOfReferen ces></MedlineCitation >
- <PubmedData>
- <History>
- <PubMedPubDat e PubStatus="pubm ed"><Year>200 1</Year><Month>10</Month><Day>18</Day><Hour>10</Hour><Minute>0</Minute></PubMedPubDate>
- <PubMedPubDat e PubStatus="medl ine"><Year>2002 </Year><Month>2</Month><Day>15</Day><Hour>10</Hour><Minute>1</Minute></PubMedPubDate></History><Public ationStatus>ppu blish</PublicationStat us>
- <ArticleIdList> <ArticleId IdType="pubmed" >11604973</ArticleId><Arti cleId IdType="medline ">21490760</ArticleId></ArticleIdList></PubmedData></PubmedArticle>
- <PubmedArticl e>
Nov 12 '05 #1
2 9834
You might find the Xml Bulk Upload tool easier to work with.

Create a Schema for your Xml File - heck VS will even create a Schema for
you.
You give XML Bulk upload it your Schema can tell it to create the tables for
you and so on.

Note : not always as simple as it sounds - do you have any Schema knowledge?
If not then learn it - it will be invaluable to you.

Here's a nice little article on it http://sightkeys.com?175

Steven
Founder, http://venturetogether.com

"Steven (dotnet newbie)" <an*******@disc ussions.microso ft.com> wrote in
message news:BD******** *************** ***********@mic rosoft.com...
Hello.

I am trying to create a database from an XML file. I am able to create a dataset from the XML doc, but how can I create a database schema from the
dataset and populate the database? Or is this even possible using VS.NET
2003?
Part of the XML file follows. Thanks for any help.

Steven
VS.NET 2003 and C# newbie!

----- Part of the XML (one full record across several tables) --------

<!DOCTYPE PubmedArticleSe t...>
- <PubmedArticleS et>
- <PubmedArticl e>
- <MedlineCitatio n Owner="NLM" Status="Complet ed"><PMID>11604 973</PMID>
- <DateCreated><Y ear>2001</Year><Month>10</Month><Day>17</Day></DateCreated> - <DateCompleted> <Year>2002</Year><Month>02</Month><Day>14</Day></DateComplete
d> - <Article>
- <Journal><ISSN> 1569-6332</ISSN>
- <JournalIssue PrintYN="Y"><Vo lume>10</Volume><Issue>P t 2</Issue>
- <PubDate><Year> 2001</Year></PubDate></JournalIssue></Journal><Articl eTitle>P
ersonal health information-seeking: a qualitative review of the
literature.</ArticleTitle> - <Pagination><Me dlinePgn>1484-8</MedlinePgn></Pagination>
- <Abstract><Abst ractText>This ....</AbstractText></Abstract><Affil iation>Division of Biomedical Informatics
and Outcomes Research, Oregon Health Sciences University, Portland, OR, USA.
zs*****@therive r.com</Affiliation> - <AuthorList CompleteYN="Y">
- <Author><LastNa me>Stavri</LastName><ForeN ame>P Z</ForeName><Initi als>PZ</Initials></Author></AuthorList><Lan guage>eng</Lang
uage> - <PublicationTyp eList><Publicat ionType>Journal Article</PublicationType ><PublicationTy pe>Review</PublicationType ><Publicati
onType>Review Literature</PublicationType ></PublicationType List></Article> - <MedlineJournal Info><Country>N etherlands</Country><Medlin eTA>Medinfo</Medlin
eTA><NlmUniqueI D>7600347</NlmUniqueID></MedlineJournalI nfo><CitationSu bset>I
M</CitationSubset> - <MeshHeadingLis t>
- <MeshHeading><D escriptorName MajorTopicYN="N ">Health Education</DescriptorName> <QualifierNam e
MajorTopicYN="Y ">utilizati on</QualifierName></MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="N ">Health Services Accessibility</DescriptorName> </MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="N ">Health Services Needs and Demand</DescriptorName> </MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="N ">Human</DescriptorName> </MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="N ">Informati on Services</DescriptorName> <QualifierNam e
MajorTopicYN="Y ">utilizati on</QualifierName></MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="Y ">Patient Acceptance of Health Care</DescriptorName> </MeshHeading> - <MeshHeading><D escriptorName MajorTopicYN="N ">Patient Participation</DescriptorName> </MeshHeading></MeshHeadingList ><NumberOfRef er
ences>63</NumberOfReferen ces></MedlineCitation > - <PubmedData>
- <History>
- <PubMedPubDat e PubStatus="pubm ed"><Year>200 1</Year><Month>10</Month><Day>18</Day><Hour>10</
Hour><Minute>0</Minute></PubMedPubDate> - <PubMedPubDat e PubStatus="medl ine"><Year>2002 </Year><Month>2</Month><Day>15</Day><Hour>10</
Hour><Minute>1</Minute></PubMedPubDate></History><Public ationStatus>ppu blish
</PublicationStat us> - <ArticleIdList> <ArticleId IdType="pubmed" >11604973</ArticleId><Arti cleId IdType="medline ">21490760</ArticleId></ArticleIdList></PubmedData></PubmedAr
ticle> - <PubmedArticl e>

Nov 12 '05 #2
Hi Steven - Xml schema can be difficult at first, but stick with it - it is
probably the coolest stuff in the Xml world (along with Xslt of course
IMHO). Once you learn it you will find it useful all over the place!

Brian Likes has some really great info on Bulk Upload and Sqlxml at
http://www.sqlxml.org/. He also links to the book which he co-wrote (and
which has a good chapter on bulk upload in it).

As for Schema. here are links to some books on Xml Schema
http://sightkeys.com?xmlschema

Any questions let me know.

Steven
Founder, http://venturetogether.com

"Steven (dotnet newbie)" <an*******@disc ussions.microso ft.com> wrote in
message news:1B******** *************** ***********@mic rosoft.com...
Thanks Steven!

I will start reading the XML Bulk link. I do not have any experience with schemas. It is on my todo list :)
Any great links on Schema knowledge?

Thanks again for your help!!

Steven Waldren

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9105
by: David Elliott | last post by:
I can create this: ?xml version="1.0" standalone="yes" ?> <ConfigOpt> <record> <Field_1>Text # 1</Field_1> <Field_2>Text # 2</Field_2> </record> </ConfigOpt>
3
5298
by: Saso Zagoranski | last post by:
Hi! A question about database tables... I have a SELECT statement: SELECT something FROM someTable WHERE code = @code The parameter code starts with 1 and is autoincremented... Now I want to add a row to the database and I do it like this: DataSet dataSet = new DataSet();
2
453
by: Fabrizio | last post by:
HI I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method The 2 dataset are filled by 2 adapters and the sources are 2 mdb database When i merge datasets, it looks like the destination dataset takes the schema, but after the AcceptChanges method I can't see any change in the MDB database What i'm missing Code follows DataSet1.Merge(DataSet2,true, System.Data.MissingSchemaAction.Add)...
2
2254
by: Frosty | last post by:
Howto make datagrid enforce rules of xml schema? Created xml schema in the designer. Constraints created there using the following <xs:simpleType name="zipcode"><xs:restriction base="xs:string"><xs:pattern value="\d{5}" /></xs:restriction></xs:simpleType Datagrid does not enforce this rule, even though dataGrid1_Validating() is called. dataset.WriteXml() saves withouth any warning, but
0
5830
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database which indexes computer magazine articles for personal reference. I am developing a Visual Basic.NET program whose sole purpose is to enter new records into the database. No updates to existing entries, no deletions, and no display
10
1553
by: Grumpy Aero Guy | last post by:
Visual Studio .net Academic Edition: After creating a OLEdbDataadapter, followed by an OLE DB Connection (all of which occurs successfully, by the way), I am unable to create a Dataset. I consistently receive a dialogbox indicating that "there were errors creating the dataset, rebuild the solution, fix any errors and try again". Upon (re)building the solution, there are no errors thrown and the dataset can still NOT be created.
3
1951
by: shapper | last post by:
Hello, I need to add a XML file from an Access database. Could someone tell me what would be the best approach? Thanks, Miguel
1
1205
by: donet programmer | last post by:
I have a requirement where I need to create a dataset that consists of a table inside a table ( a child table inside a parent table). I am not really familiar with the data relations and not sure how to represent this relation. I did create a schema and it looks good on paper, but when I create a dataset from this schema it does not allow me to write to the child table. I am elaborate more if required. This is what my schema looks...
0
2297
by: DrSnap | last post by:
Hi, Admitted I am a newbie to Oracle (databases in general) but now Ive installed the Oracle DB v.10g and the ODAC development tools for Microsoft Visual Studio 2005. So, now i've found out, how to get data from a table. doing the following:
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.