I'm using Visual Web Developer 2008.
I'd like to pull a week of data by using a calendar control.
I have a calendar control and a gridview with a datasource tied to the calendar.
When I select last week, it just shows Monday's data. When I select another week, it shows nothing. Every day has data though.
Can someone point me in the right direction?
here's the code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="WeeklyCount.aspx.vb" Inherits="WeeklyCount" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns="<head runat="server">
<title>Weekly Count</title>
<asp:Literal ID="Literall" runat="server"></asp:Literal>
</head>
<body>
<form id="frmCalendar" runat="server">
<asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC"
BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px"
SelectionMode="DayWeek" ShowGridLines="True" Width="220px">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</asp:Calendar>
<br />
<asp:GridView ID="GridView1" runat="server" DataSourceID="AccessDataSource1">
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/OrderCount.mdb"
SelectCommand="SELECT [RecDate], [Accessories], [BlankStock], [Other], [POD], [Engraving], [RowTotal], [Ribbons], [Offset], [Napkins], [Matches] FROM [qry3McWkCountRevised] WHERE ([RecDate] = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="Calendar1" Name="RecDate"
PropertyName="SelectedDate" Type="DateTime" />
</SelectParameters>
</asp:AccessDataSource>
</form>
</body>
</html>
Thanks,
Steve
I'd like to pull a week of data by using a calendar control.
I have a calendar control and a gridview with a datasource tied to the calendar.
When I select last week, it just shows Monday's data. When I select another week, it shows nothing. Every day has data though.
Can someone point me in the right direction?
here's the code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="WeeklyCount.aspx.vb" Inherits="WeeklyCount" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns="<head runat="server">
<title>Weekly Count</title>
<asp:Literal ID="Literall" runat="server"></asp:Literal>
</head>
<body>
<form id="frmCalendar" runat="server">
<asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC"
BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px"
SelectionMode="DayWeek" ShowGridLines="True" Width="220px">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</asp:Calendar>
<br />
<asp:GridView ID="GridView1" runat="server" DataSourceID="AccessDataSource1">
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/OrderCount.mdb"
SelectCommand="SELECT [RecDate], [Accessories], [BlankStock], [Other], [POD], [Engraving], [RowTotal], [Ribbons], [Offset], [Napkins], [Matches] FROM [qry3McWkCountRevised] WHERE ([RecDate] = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="Calendar1" Name="RecDate"
PropertyName="SelectedDate" Type="DateTime" />
</SelectParameters>
</asp:AccessDataSource>
</form>
</body>
</html>
Thanks,
Steve