Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / May 2006

Tip: Looking for answers? Try searching our database.

What is wrong with the data binding?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ben L - 15 May 2006 18:51 GMT
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.
Alvin Bruney - 16 May 2006 00:45 GMT
let's see the code. Couple things you can check before - check for
ispostback, check to make sure data is in the dataset.

Signature

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

> I'm just following along with the video tutorials on the asp.net website.
> I'm
[quoted text clipped - 11 lines]
> Thanks,
> Ben.
Ben L - 16 May 2006 21:51 GMT
</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>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.