473,382 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

XmlTextReader & CNN RSS Feed

Hello,

I am using the following to get RSS Feeds. I've been able to get the xml
files from every site except CNN. When I try to get there feed, I get the
exception:

A column named 'link' already belongs to this DataTable: cannot set a nested
table name to the same name.

Any help with this would be appreciated. Thanks, sck10
try
{
WebRequest req =
WebRequest.Create(http://rss.cnn.com/rss/cnn_topstories.rss);

// Get Website Proxy
req.Proxy = new WebProxy("global.proxy.lucent.com:8000", true);
req.Proxy.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();

// Stream the data
StreamReader textReader = new StreamReader(resp.GetResponseStream());
XmlTextReader xmlReader = new XmlTextReader(textReader);
//XmlReader rssReader = new XmlTextReader(rssUrl);

// Build Dataset
DataSet dsRSS = new DataSet();
dsRSS.ReadXml(xmlReader);

// Populate Repeater Tool
rptRSS.DataSource = dsRSS.Tables["item"];
rptRSS.DataBind();
}

catch(Exception ex)
{
this.pnlMessage.Visible = true;
this.lblMessageTitle.Text = "RSS Feed Error";
this.lblMessageText.Text =
"<span class=BlkB>Record Not Found</span><br />" +
"Problems consuming RSS Feed for" +
"<br /><br /><span class=BlkB>RSS Feed Error</span><br />" +
ex.Message.ToString();
}
Oct 5 '06 #1
5 9337
Hi sck10,

RSS feed is valid xml, but not necessary valid for a dataset.

If your purpose is to display RSS feeds on your webpage, I would recommend
some well built custom controls:

#RssFeed
http://scottonwriting.net/sowBlog/RssFeed.htm

#Awesome ASP.NET 2.0 RSS Tool-Kit
http://weblogs.asp.net/scottgu/archi...22/438738.aspx

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #2
Thanks Walter,
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:RD**************@TK2MSFTNGXA01.phx.gbl...
Hi sck10,

RSS feed is valid xml, but not necessary valid for a dataset.

If your purpose is to display RSS feeds on your webpage, I would recommend
some well built custom controls:

#RssFeed
http://scottonwriting.net/sowBlog/RssFeed.htm

#Awesome ASP.NET 2.0 RSS Tool-Kit
http://weblogs.asp.net/scottgu/archi...22/438738.aspx

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your
reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Oct 6 '06 #3
Hi Walter,

I downloaded the RSS Toolkit. Do you know how to set the web proxy for
this?

Thanks,
sck10

"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:RD**************@TK2MSFTNGXA01.phx.gbl...
Hi sck10,

RSS feed is valid xml, but not necessary valid for a dataset.

If your purpose is to display RSS feeds on your webpage, I would recommend
some well built custom controls:

#RssFeed
http://scottonwriting.net/sowBlog/RssFeed.htm

#Awesome ASP.NET 2.0 RSS Tool-Kit
http://weblogs.asp.net/scottgu/archi...22/438738.aspx

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your
reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Oct 11 '06 #4
Hi sck10,

Currently the toolkit didn't expose a method or property to let you specify
a proxy when it downloads the rss. Fortunately, we have the source code so
it should be easy to add this. In RssDownloadManager.cs:

RssChannelDom DownloadChannelDom(string url) {
// look for disk cache first
RssChannelDom dom = TryLoadFromDisk(url);

if (dom != null) {
return dom;
}

// download the feed
byte[] feed = new WebClient().DownloadData(url);
You can refer to WebClient.Proxy documentation on how to add proxy support:

#WebClient.Proxy Property (System.Net)
http://msdn2.microsoft.com/en-us/lib...ent.proxy.aspx

Please let me know if you need more information on this.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 12 '06 #5
Thanks Walter.

Regards, sck10

"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:Ka**************@TK2MSFTNGXA01.phx.gbl...
Hi sck10,

Currently the toolkit didn't expose a method or property to let you
specify
a proxy when it downloads the rss. Fortunately, we have the source code so
it should be easy to add this. In RssDownloadManager.cs:

RssChannelDom DownloadChannelDom(string url) {
// look for disk cache first
RssChannelDom dom = TryLoadFromDisk(url);

if (dom != null) {
return dom;
}

// download the feed
byte[] feed = new WebClient().DownloadData(url);
You can refer to WebClient.Proxy documentation on how to add proxy
support:

#WebClient.Proxy Property (System.Net)
http://msdn2.microsoft.com/en-us/lib...ent.proxy.aspx

Please let me know if you need more information on this.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Oct 12 '06 #6

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

Similar topics

0
by: Blink | last post by:
I'm using the XmlTextReader class to parse an XML feed. I need to search for elements that may or may not be there; for example, if there was an error with my request the XML will contain an...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: Nathan Alden | last post by:
I have an XSD defined as the following: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"...
0
by: Rik Brooks | last post by:
I've been working on this all day and finally I surrender. What I'm trying to do should be simple, I think. I'm trying to read an rss feed from cnn and use that to populate an asp.net table...
17
by: Slonocode | last post by:
Is there any relation between the NodeType and the Text when using the XmlTextReader? The documentation uses select/case while using the xmltextreader. While reader.Read() Select Case...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
9
by: Jimmy | last post by:
Hello, If I want to check in C# code that if there is a & in my string variable using RegExp, how should I inform RegExp about &-char? Is just &, \&, &amp; or something else? I have strucled with...
3
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" ,...
1
by: TheDude5B | last post by:
hi, I have a function which reads the xml from a web url into the XmlTextReader, and then I work my way through the reader producing html from the different nodes. All the code works fine when I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.