473,387 Members | 1,791 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,387 software developers and data experts.

newbie to xml rss

19
Brand new to xml and I'm trying to get Scott Mitchell's rss aggregator example working locally. Basically, involves a frameset with the channels(feeds) in the left frame, a list of items in the channel in the lower right, and the single item in the top right based on a selection in the lower right. When the channel within the left frame is clicked, bottom right frame changes with the items for the channel (feed). Taking it step-by-step. Have left frame loading from sql2005 and it's working great. Next I'm working on the list of items in the bottom right frame. (don't event have the soure identified in the top right as yet). Problem is, he wrote it in C and I don't have a clue. Converted it, but I'm having problems. Anybody able to provide simplistic help for a newbie? right now, it's stopping with an error of:

System.FormatException: Input string was not in a correct format.
for the line:
Dim feedXML As XmlDocument = CType(Cache("channel" + channelID), XmlDocument)




Expand|Select|Wrap|Line Numbers
  1. <%@ Import Namespace="System.Web.UI.WebControls" %>
  2. <%@ Import Namespace="System.Data" %>
  3. <%@ Import Namespace="System.Data.SqlClient" %>
  4. <%@ Import Namespace="System.Xml" %>
  5. <%@ Import Namespace="System.Xml.xsl" %>
  6. <%@Page Language="VB" debug="True"%>
  7. <script language="vb" runat="server">
  8. Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
  9.  Dim channelID As Integer 
  10.  if Request.QueryString("channelID")="" then channelID=0 else channelID=Int32.Parse(Request.QueryString("channelID")) 
  11.  Dim feedXML As XmlDocument = CType(Cache("channel" + channelID), XmlDocument) 
  12.  If feedXML Is Nothing Then 
  13.    Dim myConnection As SqlConnection = New SqlConnection("connect stuff;") 
  14.    Dim SQL_QUERY As String = "SELECT URL, UpdateInterval FROM its.dbo.xTblRssChannels WHERE channelID = @channelID" 
  15.    Dim myCommand As SqlCommand = New SqlCommand(SQL_QUERY, myConnection) 
  16.    Dim feedParam As SqlParameter = New SqlParameter("@channelID", SqlDbType.Int, 4) 
  17.    feedParam.Value = channelID 
  18.    myCommand.Parameters.Add(feedParam) 
  19.    myConnection.Open 
  20.    Dim reader As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) 
  21.    reader.Read 
  22.    Dim feedURL As String = reader("URL").ToString 
  23.    Dim updateInterval As Integer = Int32.Parse(reader("UpdateInterval").ToString) 
  24.    myConnection.Close 
  25.    feedXML = New XmlDocument 
  26.    feedXML.Load(feedURL) 
  27.    Cache.Insert("channel" + channelID, feedXML, Nothing, DateTime.Now.AddMinutes(updateInterval), TimeSpan.Zero) 
  28.  End If 
  29.  xmlNewsItems.Document = feedXML 
  30.  Dim xsltArgList As Xsl.XsltArgumentList = New XsltArgumentList 
  31.  xsltArgList.AddParam("channelID", "", channelID) 
  32.  xmlNewsItems.TransformArgumentList = xsltArgList 
  33. End Sub
  34. </script>
  35. <script language="javascript">
  36.   // display a blank page in the bottom frame when the news items loads
  37.   parent.rbottom.location.href = "about:blank";
  38. </script>
  39. </head>
  40. <body>
  41. <form id="Form1" method="post" runat="server">
  42.  <asp:Xml id="xmlNewsItems" runat="server" TransformSource="rssItems.xslt"></asp:Xml>
  43. </body>
  44. </HTML>
Aug 18 '06 #1
0 1316

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Philippe C. Martin | last post by:
Hi, Is there a program out there that would generate the C code to instantiate objects and call them: ex: miracle.exe -i mymodule.py -o module_internface.c ? I seem to recall a _yes_ to...
0
by: Twayne | last post by:
Twayne wrote: That's the verification I was looking for I think. There are times that doesn't seem to be so, but perhaps I'll looking at the wrong side of the tree in the wrong forest ... I...
5
by: Banibrata Dutta | last post by:
Hi, I've gone through the list of "language differences" between 2.3 / 2.4 & 2.5 of CPython. I've spend around 2 weeks now, learning v2.5 of CPython, and I consider myself still very very...
16
by: Raxit | last post by:
Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy...
10
by: Peter Michaux | last post by:
On May 14, 8:55 pm, Prisoner at War <prisoner_at_...@yahoo.comwrote: Get it from the library. I cannot imagine needing to own an HTML book. There are plenty of good references on the web....
2
by: r_ahimsa_m | last post by:
Could you recommend me some free JavaScript validator? I was using JSlint but it reports nonsense errors. Please help. Thanks. /RAM/
6
by: raylopez99 | last post by:
Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? Subject: Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? My...
3
Lokean
by: Lokean | last post by:
Sorry for this newbie question, this is not my realm of expertese. I have searched google, tried several applications that claim they can do this, such as Mapforce, which I found confusing, to...
5
by: Dave | last post by:
I am new to Visual Web Developer 2005 Expres. I am using absolute positioning and every time I add a button control to my web form its width extends all the way to the edge of the page. IOW I...
5
by: SharkD | last post by:
Hi! I'm a total newbie when it comes to ASP (or any type of server-side programming). I want to start a project that does the following: 1. query Wikipedia for information regarding...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.