C
Chet C
I am trying to make a simple RSS reader using asp.net (VB) and am
getting an error when I run the project locally (works fine after being
published) Here is my basic code:
Sub Page_Load(sender as Object, e as EventArgs)
Dim url As String = _
"http://www.dailyaudiobible.com/wordpress/?feed=rss2"
recentPosts.DataSource = GetRSSFeed(url)
'recentPosts is a gridview control on the aspx page.
recentPosts.DataBind()
End Sub
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
This page works fine when I publish it to my web server. When I run it
locally (http://localhost:9999/xxxxx) I get the error "Cannot find table
2" on the "Return ds.Tables(2)" line of GetRSSFeed. I originally was
guessing that this has something to do with my proxy/firewall (ISA
Server 2004) but I set up a monitor and watched it and don't see
anything being rejected. Could it be due to a permissions setting in
Visual Studio? The reason I wonder if it's not a firewall thing is
because the published server sits behind the same firewall. I'm working
on XP Pro, the publishing server is Server 2003.
I've tried several different RSS and Atom feeds with the same results,
and have tried some other xml reader structures also... same result. I
have also tried the code on my home computer (disabled all firewalls
temporarily) with the same result; sure seems to be something with
either XP IIS server or the VS.NET environment...
Any help would be appreciated; thank you!
getting an error when I run the project locally (works fine after being
published) Here is my basic code:
Sub Page_Load(sender as Object, e as EventArgs)
Dim url As String = _
"http://www.dailyaudiobible.com/wordpress/?feed=rss2"
recentPosts.DataSource = GetRSSFeed(url)
'recentPosts is a gridview control on the aspx page.
recentPosts.DataBind()
End Sub
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
This page works fine when I publish it to my web server. When I run it
locally (http://localhost:9999/xxxxx) I get the error "Cannot find table
2" on the "Return ds.Tables(2)" line of GetRSSFeed. I originally was
guessing that this has something to do with my proxy/firewall (ISA
Server 2004) but I set up a monitor and watched it and don't see
anything being rejected. Could it be due to a permissions setting in
Visual Studio? The reason I wonder if it's not a firewall thing is
because the published server sits behind the same firewall. I'm working
on XP Pro, the publishing server is Server 2003.
I've tried several different RSS and Atom feeds with the same results,
and have tried some other xml reader structures also... same result. I
have also tried the code on my home computer (disabled all firewalls
temporarily) with the same result; sure seems to be something with
either XP IIS server or the VS.NET environment...
Any help would be appreciated; thank you!