Gridview is not showing up in browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark webber
    New Member
    • Nov 2011
    • 1

    #1

    Gridview is not showing up in browser

    My Gridview is not showing up in browser.

    Here is the code for my GridView:
    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="daily_report_console.aspx.vb" Inherits="daily_report_console" %>
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html>
    <head>
    <title>Daily Report</title>
    
    <style type="text/css">
    .style1
    {
    width: 404px;
    }
    </style>
    
    </head>
    <body>
    
    <form id="form1" runat="server">
    <center>
    <table border="2" cellspacing="0" cellpadding="30" width="" style="border-color:#336699">
    
    <tr>
    <td align="center" class="style1">
    <table border="0" cellspacing="0" cellpadding="10">
    <td><img src="image/DRC.jpg" alt="Extolcorp MSC Bhd" /></td>
    </tr>
    
    <tr>
    <td><center>
    <asp:Calendar ID="Calendar1" runat="server" BackColor="White" 
    BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" 
    ForeColor="Black" Height="190px" NextPrevFormat="FullMonth" Width="350px">
    <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
    <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" 
    VerticalAlign="Bottom" />
    <OtherMonthDayStyle ForeColor="#999999" />
    <SelectedDayStyle BackColor="#333399" ForeColor="White" />
    <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" 
    Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />
    <TodayDayStyle BackColor="#CCCCCC" />
    </asp:Calendar>
    </td>
    </center>
    </tr>
    
    <tr>
    <td>
    <asp:Button ID="Button1" runat="server" Text="Back" Width="95px" />&nbsp
    <asp:TextBox ID="TextBox1" runat="server">Select Date</asp:TextBox>&nbsp
    <asp:Button ID="Button2" runat="server" Text="Get Report" Width="95px"/> 
    
    <br />
    </td>
    </tr>
    </table> 
    
    </table>
    
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
    </asp:GridView>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:guestConnectionString2 %>" 
    ProviderName="<%$ ConnectionStrings:guestConnectionString2.ProviderN ame %>" 
    SelectCommand="SELECT id, date, f_name, l_name, person_2_meet, time_entered, time_exited, email FROM guest WHERE DATE(date) = DATE(NOW())">
    <SelectParameters>
    <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="date" PropertyName="Text" Type="String" />
    </SelectParameters>
    </asp:SqlDataSource>
    
    </form>
    
    </body>
    </html>
    Last edited by Frinavale; Nov 24 '11, 04:27 PM. Reason: Added the question/problem to the body of the thread so that it isn't not just a bunch of code posted. Please include the question and details in the body of the thread when asking a question.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    The first thing I'd try to fix this problem is change the select statements for the SQLDataSources to "Select * From Table".

    I would also make sure that my connection strings were correct and in the right place.

    Comment

    Working...