GridView not displaying

Discussion in '.NET' started by chevy372, Feb 3, 2010.

  1. chevy372

    chevy372

    Joined:
    Feb 3, 2010
    Messages:
    1
    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" />
    <Columns>
    <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}" />
    </Columns>
    <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:GridView>

    <asp:AccessDataSource ID="U4GP_AccessDataSource" runat="server"
    DataFile="~/App_Data/OnlineBankingData.mdb"





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

    Ideas?
    chevy372, Feb 3, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,956
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  2. Greg Lyles
    Replies:
    8
    Views:
    567
    Billy Biro
    Dec 4, 2006
  3. =?Utf-8?B?SmF6emE=?=

    GridView not displaying on page after postback

    =?Utf-8?B?SmF6emE=?=, Oct 25, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    689
    =?Utf-8?B?SmF6emE=?=
    Oct 26, 2007
  4. Paul

    gridview not displaying data.

    Paul, Jun 18, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    1,408
  5. Sunny
    Replies:
    0
    Views:
    198
    Sunny
    Jul 13, 2006
Loading...

Share This Page