Thanks for the post. I get an error message when I try to implement the 'other approach'. I'm a beginner so I apologize if I should understand this error... Thanks for any help you can give!
The error says:
Server Error in '/' Application.
Parser Error
Description:
An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'UberAspNet.RSS.NewsWire'.
Source Error:
Line 1: <%@ Page Codebehind="News_Feed.aspx.vb" Inherits="UberAspNet.RSS.NewsWire" EnableViewState="false" %>
Line 2: <%@ OutputCache Duration="300" VaryByParam="none" %>
Source File: /rss/news_feed2.aspx Line:
1
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
"description",
"The latest news and events for YPC of Greater Des Moines")
objX.WriteElementString(
"copyright",
"(c) 2006, Young Professionals Connection of Greater Des Moines, All rights reserved.")
objX.WriteElementString(
"ttl",
"5")
Dim objConnection
As New SqlConnection(ConfigurationSettings.AppSettings("ClubSiteDB"))
objConnection.Open()
Dim sql As
String = SelectCommand =
"SELECT top 5 events.id, events.starttime, events.endtime, events.title, locations.title AS locationname FROM events LEFT OUTER JOIN locations ON events.location = locations.id WHERE (events.starttime > GETDATE()) ORDER
BY events.starttime, events.id "
Dim objCommand
As New SqlCommand(sql, objConnection)
Dim objReader
As SqlDataReader = objCommand.ExecuteReader()
While objReader.Read()
None
0 Points
9 Posts
Re: Rss
Nov 04, 2006 08:53 PM|mletsch|LINK
Mr. Lunch,
Thanks for the post. I get an error message when I try to implement the 'other approach'. I'm a beginner so I apologize if I should understand this error... Thanks for any help you can give!
The error says:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'UberAspNet.RSS.NewsWire'.
Source Error:
Source File: /rss/news_feed2.aspx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Here's my code:
File one (news_feed2.aspx):
<%
@ Page Codebehind="News_Feed.aspx.vb" Inherits="UberAspNet.RSS.NewsWire" EnableViewState="false" %><%
@ OutputCache Duration="300" VaryByParam="none" %>File two (news_feed.aspx.vb):
Imports
SystemImports
System.ConfigurationImports
System.DataImports
System.Data.SqlClientImports
System.TextImports
System.WebImports
System.XmlNamespace
UberAspNet.RSS Public Class NewsWire Inherits System.Web.UI.PageResponse.Clear()
Response.ContentType =
"text/xml" Dim objX As New XmlTextWriter(Response.OutputStream, Encoding.UTF8)objX.WriteStartDocument()
objX.WriteStartElement(
"rss")objX.WriteAttributeString(
"version", "2.0")objX.WriteStartElement(
"channel")objX.WriteElementString(
"title", "YPC of Greater Des Moines News & Events Feed")objX.WriteElementString(
"link", "http://www.ypcdsm.com/rss/news_feed.aspx")objX.WriteElementString(
"description", "The latest news and events for YPC of Greater Des Moines")objX.WriteElementString(
"copyright", "(c) 2006, Young Professionals Connection of Greater Des Moines, All rights reserved.")objX.WriteElementString(
"ttl", "5") Dim objConnection As New SqlConnection(ConfigurationSettings.AppSettings("ClubSiteDB"))objConnection.Open()
Dim sql As String = SelectCommand = "SELECT top 5 events.id, events.starttime, events.endtime, events.title, locations.title AS locationname FROM events LEFT OUTER JOIN locations ON events.location = locations.id WHERE (events.starttime > GETDATE()) ORDER BY events.starttime, events.id " Dim objCommand As New SqlCommand(sql, objConnection) Dim objReader As SqlDataReader = objCommand.ExecuteReader() While objReader.Read()objX.WriteStartElement(
"item")objX.WriteElementString(
"title", objReader.GetString(0))objX.WriteElementString(
"description", objReader.GetString(1))objX.WriteElementString(
"link", "http://www.ypcdsm.com/events_view.aspx?eventid=" + objReader.GetInt32(2).ToString())objX.WriteElementString(
"pubDate", objReader.GetDateTime(3).ToString("R"))objX.WriteEndElement()
End WhileobjReader.Close()
objConnection.Close()
objX.WriteEndElement()
objX.WriteEndElement()
objX.WriteEndDocument()
objX.Flush()
objX.Close()
Response.End()
End Sub End ClassEnd
Namespace