Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > What is wrong with the data binding?

Reply
Thread Tools

What is wrong with the data binding?

 
 
Ben L
Guest
Posts: n/a
 
      05-15-2006
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.

 
Reply With Quote
 
 
 
 
Ben L
Guest
Posts: n/a
 
      05-16-2006
</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.Provid erName %>"
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=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
<add name="NORTHWNDConnectionString1" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP PORT command sends the wrong IP address for data channel over VPN steve.wadlow@dendrite.com Cisco 0 05-03-2005 08:57 PM
SDLC STUN local ack - R R 00 data from wrong address! Mark Cisco 0 04-26-2005 11:27 AM
Big Problem with Web App Sending Wrong Data! HELP! David Hearn ASP .Net 0 04-18-2005 08:55 PM
Is XML Doc wrong or is Schema wrong? (or both) Matthew XML 7 01-07-2005 10:05 PM
Dropdown displaying data in the wrong order Irishmaninusa ASP .Net 2 08-27-2004 09:30 PM



Advertisments