K
keekaye
This was working ok but I changed something and I don't know where but
it's no longer working. I get "Could Not Start Session" error. I'm
sure it's something obvious but this is my first stab at .net. Any
help would be appreciated!
Lisa
Here is the live link and the error:
http://www.noefc.info/events_calendar2.aspx
Here is the SOURCE:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language = "VB" debug = "true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server">
Dim ds As DataSet = New DataSet()
Protected Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim connectionstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath("data/noefc.mdb") +";"
Dim sql As String = "select * from events"
Dim da As OleDbDataAdapter = New
OleDbDataAdapter(sql,connectionstring)
da.Fill(ds, "events")
End Sub
public sub eventscalendar_DayRender(s as object, e as
DayRenderEventArgs)
Dim strEvents As StringBuilder = New StringBuilder()
strEvents.Append("<span style=""font-size:80%"">")
Dim dsrow As DataRow
Dim row As DataRowView
For Each dsrow In ds.Tables("events").Rows
Dim eventdate As DateTime = CType(dsrow("start_date"), DateTime)
Dim eventID AS string = dsrow("eventID")
If eventdate.Equals(E.Day.Date) Then
If IsDBNull(dsrow("start_time")) Then
strEvents.Append("<br /><br />" + dsrow("start_time") +
"<a href='event_update.aspx'>"+ dsrow("eventTitle")+"</a>")
Else
strEvents.Append("<br /><br />" + (CType(dsrow("start_time"),
DateTime)).ToString("t") + "<br /><a href='event_detail.asp?varID="
+eventID +"' target='_blank'>" + dsrow("eventTitle")+"</a>")
End If
end if
Next
strEvents.Append("</span>")
E.Cell.Controls.Add(New LiteralControl(strEvents.ToString()))
end sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Event Calendar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
<form runat="server">
<asp:calendar BackColor="#FFFFFF" BorderColor="#00CCFF"
BorderStyle="groove" CellPadding="2" DayHeaderStyle-BackColor="#00CCFF"
DayStyle-HorizontalAlign="right" DayStyle-VerticalAlign="top"
Font-Name="verdana" Font-Names="arial" Font-Size="10" Height="600"
ID="eventcalendar" runat="server" ShowGridLines="true"
TitleStyle-BackColor="#0000FF" TitleStyle-Font-Size="14"
TitleStyle-ForeColor="#FFFFFF" TodayDayStyle-BackColor="#66CCFF"
TodayDayStyle-BorderColor="#FFFFCC" TodayDayStyle-ForeColor="#0000CC"
Width="950"
OnDayRender="eventscalendar_DayRender"></asp:calendar></asp:calendar>
</form>
</body>
</html>
it's no longer working. I get "Could Not Start Session" error. I'm
sure it's something obvious but this is my first stab at .net. Any
help would be appreciated!
Lisa
Here is the live link and the error:
http://www.noefc.info/events_calendar2.aspx
Here is the SOURCE:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language = "VB" debug = "true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server">
Dim ds As DataSet = New DataSet()
Protected Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim connectionstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+
Server.MapPath("data/noefc.mdb") +";"
Dim sql As String = "select * from events"
Dim da As OleDbDataAdapter = New
OleDbDataAdapter(sql,connectionstring)
da.Fill(ds, "events")
End Sub
public sub eventscalendar_DayRender(s as object, e as
DayRenderEventArgs)
Dim strEvents As StringBuilder = New StringBuilder()
strEvents.Append("<span style=""font-size:80%"">")
Dim dsrow As DataRow
Dim row As DataRowView
For Each dsrow In ds.Tables("events").Rows
Dim eventdate As DateTime = CType(dsrow("start_date"), DateTime)
Dim eventID AS string = dsrow("eventID")
If eventdate.Equals(E.Day.Date) Then
If IsDBNull(dsrow("start_time")) Then
strEvents.Append("<br /><br />" + dsrow("start_time") +
"<a href='event_update.aspx'>"+ dsrow("eventTitle")+"</a>")
Else
strEvents.Append("<br /><br />" + (CType(dsrow("start_time"),
DateTime)).ToString("t") + "<br /><a href='event_detail.asp?varID="
+eventID +"' target='_blank'>" + dsrow("eventTitle")+"</a>")
End If
end if
Next
strEvents.Append("</span>")
E.Cell.Controls.Add(New LiteralControl(strEvents.ToString()))
end sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Event Calendar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
<form runat="server">
<asp:calendar BackColor="#FFFFFF" BorderColor="#00CCFF"
BorderStyle="groove" CellPadding="2" DayHeaderStyle-BackColor="#00CCFF"
DayStyle-HorizontalAlign="right" DayStyle-VerticalAlign="top"
Font-Name="verdana" Font-Names="arial" Font-Size="10" Height="600"
ID="eventcalendar" runat="server" ShowGridLines="true"
TitleStyle-BackColor="#0000FF" TitleStyle-Font-Size="14"
TitleStyle-ForeColor="#FFFFFF" TodayDayStyle-BackColor="#66CCFF"
TodayDayStyle-BorderColor="#FFFFCC" TodayDayStyle-ForeColor="#0000CC"
Width="950"
OnDayRender="eventscalendar_DayRender"></asp:calendar></asp:calendar>
</form>
</body>
</html>