SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Training
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
SQL Azure
Developer
General DBA
ASP.NET / ADO.NET
SQL Azure

USEFUL SITES :

ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server

More     
 
Latest FAQ's

Add Node to A SQL Server failover Cluster failed with invalid ...
SQL Server Destination remote server error
Setting Up Data And Log Files For SQL Server
Will Check Constraints Improve Database Performance?

More     
   
Latest Software Reviews

dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008

More     

articles >> developer >> Getting Started with the ADO.NET Entity Framework ...

Getting Started with the ADO.NET Entity Framework Part 4

By : Joydip Kanjilal
Jan 02, 2009

This article is the final article of a 4-part series on the ADO.NET Entity Framework. This article will describe how to use the Entity Data Model and the Entity Data Source Control to implement a program using the Entity Framework. Using a GridView control to display bound data.  Refer to the solution we created earlier using the Entity Data Model Designer and follow the steps below:

1. Drag and drop an Entity Data Source control from the toolbox onto your Default.aspx web form.

2. Click on the Configure Data Source option to specify the data source as shown below.

 

3. Specify the Connection String and DefaultContainerName and then click on Next.

4. Specify the fields you would want to retrieve from the database table and
when done click Finish.

5. Drag and drop a GridView control from the toolbox onto the Default.aspx web form as seen below.



6. Use the Choose Data Source option of the GridView control to associate its data source with the Entity Data Source control we created earlier. Refer to the following figure:



Below is how the markup code of the GridView control looks with its templates defined. Note how the DataSourceID of the GridView control has been associated with the Entity Data Source control created earlier.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns=
"False" DataKeyNames="EmployeeID"
DataSourceID="SqlDataSource1" BorderColor="Black" BorderStyle="Solid" Width="400px">
<Columns>
<asp:BoundField DataField="EmployeeID" HeaderText="Employee ID" ReadOnly="True" SortExpression="EmployeeID" />
<asp:BoundField DataField="FirstName" HeaderText=
"First Name" SortExpression="FirstName" />
<asp:BoundField DataField="LastName" HeaderText=
"Last Name" SortExpression="LastName" />
<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
</Columns>
</asp:GridView>

It's now done! When the application is executed, the output should be similar to what is shown below:

 

Summary
This series of articles has discussed how to get started with the ADO.NET Entity Framework. Learning how to create an Entity Data Model and use it along with the Entity Data Source control to bind data to a GridView data control.

        








C# Help and Tutorials | PHP MySQL Tutorial | Sharepoint Tutorial | Azure Tutorial | Cloud Hosting Magazine | ASP.NET Tutorials | Windows Server Help | Windows Phone Pro | Silverlight Ace | Visual Studio Tutorials | Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | SQL Server Training Videos | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 2010 Jude O'Kelly. All rights reserved