G
Guest
If I have this as my XML file
<?xml version="1.0" standalone="yes" ?>
- <opml>
- <body>
- <outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
</outline>
</body>
</opml>
And I use this code to add a new row
System.Data.DataSet myds = new System.Data.DataSet();
myds.ReadXml(@"C:\Program Files\RSSImporter\Data\feeds.xml");
System.Data.DataRow dr;
dr = myds.Tables[2].NewRow();
dr[0] = "test";
myds.Tables[2].Rows.Add(dr);
myds.AcceptChanges();
myds.WriteXml(@"C:\Program Files\RSSImporter\Data\feeds2.xml");
I end up with:
<?xml version="1.0" standalone="yes"?>
<opml>
<body>
<outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
</outline>
</body>
<outline title="test" />
</opml>
But the new row with the title "test" should go right after the CNN entry
like this:
<?xml version="1.0" standalone="yes"?>
<opml>
<body>
<outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
<outline title="test" />
</outline>
</body>
</opml>
Any idea on what I could be doing wrong?
Thanks
<?xml version="1.0" standalone="yes" ?>
- <opml>
- <body>
- <outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
</outline>
</body>
</opml>
And I use this code to add a new row
System.Data.DataSet myds = new System.Data.DataSet();
myds.ReadXml(@"C:\Program Files\RSSImporter\Data\feeds.xml");
System.Data.DataRow dr;
dr = myds.Tables[2].NewRow();
dr[0] = "test";
myds.Tables[2].Rows.Add(dr);
myds.AcceptChanges();
myds.WriteXml(@"C:\Program Files\RSSImporter\Data\feeds2.xml");
I end up with:
<?xml version="1.0" standalone="yes"?>
<opml>
<body>
<outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
</outline>
</body>
<outline title="test" />
</opml>
But the new row with the title "test" should go right after the CNN entry
like this:
<?xml version="1.0" standalone="yes"?>
<opml>
<body>
<outline text="RssImporter OPML">
<outline title="CNN" htmlUrl=""
xmlUrl="http://rss.cnn.com/rss/cnn_topstories.rss" />
<outline title="test" />
</outline>
</body>
</opml>
Any idea on what I could be doing wrong?
Thanks