GridView not displaying

Feb 3, 2010
Reaction score
I cannot get the gridview to show any data with the code below, and I have no idea why. There is data in the database that is newer than 10 days old. Here's what I have:

Option Infer On
Option Explicit On

Partial Class Customers_transactions
Inherits System.Web.UI.Page

Dim dte10DaysAgo As Date = DateTime.Now.AddDays(-10).ToString("MM/dd/yyyy")

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

calStartDate.SelectedDate = dte10DaysAgo
calStartDate.VisibleDate = dte10DaysAgo

End Sub

End Class


<asp:GridView ID="gvTransations" runat="server" AutoGenerateColumns="False" DataSourceID="U4GP_AccessDataSource"
CellPadding="4" ForeColor="#333333" GridLines="None">
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<asp:BoundField DataField="DateOccurred" HeaderText="Date Occurred"
SortExpression="DateOccurred" DataFormatString="{0:d}" />
<asp:BoundField DataField="TransactionType" HeaderText="Transaction Type"
SortExpression="TransactionType" />
<asp:BoundField DataField="AccountNo" HeaderText="Account Number"
SortExpression="AccountNo" />
<asp:BoundField DataField="TransactionAmt"
HeaderText="Transaction Amount" SortExpression="TransactionAmt"
DataFormatString="{0:c}" />
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />

<asp:AccessDataSource ID="U4GP_AccessDataSource" runat="server"

SelectCommand="SELECT [AccountNo], [DateOccurred], [TransactionAmt], [TransactionType] FROM [tblTransactions] WHERE (([CustomerID] = ?) AND ([DateOccurred] &gt;= ?)) ORDER BY [DateOccurred] DESC">
<asp:SessionParameter Name="CustomerID" SessionField="CustID" Type="Int32" />
<asp:FormParameter FormField="calStartDate" Name="DateOccurred"
Type="DateTime" />



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question