What is wrong with the data binding?

Discussion in 'ASP .Net Datagrid Control' started by Ben L, May 15, 2006.

  1. Ben L

    Ben L Guest

    I'm just following along with the video tutorials on the asp.net website. I'm
    data binding a to datagrid using the northwind.mdf file. I run a test query
    in the query builder and everything is fine, I see the correct results.
    Then I 'open in browser' to see the results, and the data grid never
    appears.
    I even make the query set to show everything, and I get nothing.

    But if I just drag in the table with no query, I do see the results in the
    web browser.
    What am I doing wrong?

    Thanks,
    Ben.
     
    Ben L, May 15, 2006
    #1
    1. Advertising

  2. Ben L

    Ben L Guest

    </head>
    <body>
    <form id="form1" runat="server" method="post">
    <div>
    <h2 align="center">
    View Your orders</h2>
    <p id="P1">



    <asp:GridView ID="GridView1" runat="server"
    AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
    EmptyDataText="There are no data records to display.">
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString1 %>"
    ProviderName="<%$
    ConnectionStrings:NORTHWNDConnectionString1.ProviderName %>"
    SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID],
    [OrderDate], [Freight], [ShippedDate] FROM [Orders]">
    </asp:SqlDataSource>
    </p>

    </div>
    </form>
    </body>
    </html>


    and in web.config

    <?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <connectionStrings>
    <add name="ASPNETDBConnectionString1" connectionString="Data
    Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated
    Security=True;User Instance=True"
    providerName="System.Data.SqlClient" />
    <add name="NORTHWNDConnectionString1" connectionString="Data
    Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated
    Security=True;User Instance=True"
    providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>
    <compilation debug="true" />
    <authentication mode="Forms" />
    </system.web>
    <system.net>
    <mailSettings>
    <smtp from="ASPWEBBY">
    <network host="smtp.msn.com" password="aaa" userName="human"
    />
    </smtp>
    </mailSettings>
    </system.net>
    </configuration>
     
    Ben L, May 16, 2006
    #2
    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. Jordan
    Replies:
    2
    Views:
    2,571
    Jordan
    Feb 10, 2004
  2. Amit
    Replies:
    6
    Views:
    13,913
    Assimalyst
    Oct 24, 2006
  3. Replies:
    2
    Views:
    907
    Kevin Grover
    Oct 20, 2006
  4. JcFx
    Replies:
    0
    Views:
    314
  5. Vivek Nallur

    value binding and function binding

    Vivek Nallur, Sep 25, 2003, in forum: Ruby
    Replies:
    0
    Views:
    152
    Vivek Nallur
    Sep 25, 2003
Loading...

Share This Page