By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,115 Members | 894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,115 IT Pros & Developers. It's quick & easy.

XmlTextReader & CNN RSS Feed

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.