Using RSS Feeds

I'm trying to use an rss feed on my asp.net website but can't get it to work. Here is the code behind the webpage:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        rssPosts.DataSource = GetRSSFeed("http://www.thepittsburghchannel.com/news/topstory.rss")
        rssPosts.DataBind()
    End Sub

    Protected Function GetRSSFeed(ByVal strURL As String) As DataTable
        'Get the XML data
        Dim reader As XmlTextReader = New XmlTextReader(strURL)

        'return a new DataSet
        Dim ds As DataSet = New DataSet()
        ds.ReadXml(reader)
        Return ds.Tables(2)
    End Function

The result when I run this is an error: A column named 'category' already belongs to this DataTable: cannot set a nested table name to the same name.

I've tried many different rss feeds and all give the same result.

Any help would be greatly appreciated.
stullhe104Asked:
Who is Participating?
 
stullhe104Connect With a Mentor Author Commented:
Thanks for the post. It does show that the rss feed is valid but that didn't help solve my problem.

I solved the problem by using RSSToolKit which I found at:
http://www.codeplex.com/ASPNETRSSToolkit

0
 
David H.H.LeeCommented:
Hi stullhe104,
Perhaps you can use online Feed Validator to check the existing RSS file:
http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.thepittsburghchannel.com%2Fnews%2Ftopstory.rss
0
 
David H.H.LeeCommented:
Hi stullhe104,
Ok, you may request admin to refund the points since you already found your own solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.