Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / April 2008

Tip: Looking for answers? Try searching our database.

Load XML with nested tables into SQL Server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Uray - 11 Apr 2008 17:34 GMT
Hi all

I have problems loading XML data into SQL Server.
What is the best way to go ? I am new in using XML documents.
I have tried to do it with "Integration Services" and
also with "XmlTextReader", "XPathDocument", "DataSet.ReadXML" ...

None of this is working well because my XML document
has nested tables and in XML documents I dont see any
relations ...

Thanks for any comment .

Best regards
Frank

Here is what the XML looks like:

 <?xml version="1.0" encoding="iso-8859-1" ?>
- <Test>
- <Transactions>
- <Trx>
 <TrxCol1>false</TrxCol1>
 <TrxCol2>SWAP</TrxCol2>
- <calendars>
 <calendar>CHF</calendar>
 </calendars>
- <legs>
- <leg>
 <LegCol1>true</LegCol1>
- <calendars>
 <calendar>JPY</calendar>
 <calendar>GBP</calendar>
 </calendars>
 <LegCol2>false</LegCol2>
- <fixings>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-03-19</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-03-20</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-03-21</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-03-22</FixingCol2>
 </fixing>
 </fixings>
 </leg>
 </legs>
 <nr>XY88.6</nr>
 </Trx>
- <Trx>
 <TrxCol1>true</TrxCol1>
 <TrxCol2>BOND</TrxCol2>
- <calendars>
 <calendar>EUR</calendar>
 </calendars>
- <legs>
- <leg>
 <LegCol1>true</LegCol1>
- <calendars>
 <calendar>USD</calendar>
 <calendar>GBP</calendar>
 </calendars>
 <LegCol2>false</LegCol2>
- <fixings>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-04-19</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-04-20</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-04-21</FixingCol2>
 </fixing>
- <fixing>
 <FixingCol1>0</FixingCol1>
 <FixingCol2>2007-04-22</FixingCol2>
 </fixing>
 </fixings>
 </leg>
 </legs>
 <nr>XY88.6</nr>
 </Trx>
 </Transactions>
 </Test>
Gugale at Lincoln - 11 Apr 2008 18:40 GMT
It will be easier to understand your problem if you describe the tables. I
think problem is becuase the way calendars is related to Transactions  and
legs. I think if you remove calendars from the xml file then you can use
dataset.ReadXMLSchema and dataset.ReadXML to load the data.
You might have to create an empty dataset by querying your tables first and
then try to use dataset.ReadXML to load the data.

> Hi all
>
[quoted text clipped - 91 lines]
>  </Transactions>
>  </Test>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.