all groups > dotnet xml > june 2004 >
You're in the

dotnet xml

group:

Error loading XML into DataSet


Error loading XML into DataSet kbolster20 NO[at]SPAM yahoo.com
6/4/2004 6:30:04 AM
dotnet xml:
Hello,

When I try to load this xml file (see below) into an asp.net dataset
using the following code:

ds.ReadXml("xmlfilepath\xmlfile.xml", XmlReadMode.Auto)

I get the following error:

"The same table (description) cannot be the child table in two nested
relations. "

If I take out the anchor tag in the description it works fine,
however, I need the anchor tag in there. Does
anyone have any suggestions?

<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<item>
<title>Star City</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
<description>How do Americans get ready to work with Russians aboard
the International Space Station? They take a crash course in culture,
language and protocol at Russia's <a
href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star
City</a>.</description>
<pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
</item>
</channel>
</rss>

Re: Error loading XML into DataSet Christoph Schittko [MVP]
6/5/2004 11:39:47 AM
Do you really have to read your XML document into a DataSet? What are you
trying to do with the DataSet after you loaded the XML?

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[quoted text, click to view]

Re: Error loading XML into DataSet Scott Wade
6/24/2004 8:44:43 AM
I'm trying to accomplish the same task and I'm receiving the same error.
I'm new to VB.Net programming and I'm trying to learn the best practices
for parsing out XML files. By reading the XML file into a DataSet, I
figured it would be easy to process tables inside a DataSet since I'm
familar with processing DataSets.

My final result is populating some tables in our database based on the
data in the XML file. Please offer some other suggestions (& reasons)
for accomplishing this task.

Thanks in advance.




*** Sent via Devdex http://www.devdex.com ***
AddThis Social Bookmark Button