ASP.NET 4.0 and the Entity Framework 4 - Part 5 - Using the GridView and the EntityDataSource
page 1 of 7
Published: 15 Jun 2010
Abstract
In this article, Vince demonstrates the usage of the GridView control to view, add, update, and delete records using the Entity Framework 4. After providing a short introduction, he provides the steps required to create a web site, entity data model, web form and template fields with the help of relevant source code and screenshots.
by Vince Varallo
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 34994/ 45

Introduction

This article will demonstrate how to view and edit records in a table using the GridView, EntityDataSource, and Validator controls.  The article also demonstrates how to generate an ADO.NET Entity Data Model to update and delete records in a table.  At the end of this article you'll notice that there wasn't one line of code needed to edit the records in the table. 

This article uses the AdventureWorks sample database that can be downloaded from http://msftdbprodsamples.codeplex.com/releases/view/37109 for SQL Server 2008.  Download and install the AdventureWorks2008_SR4.exe file.  The sample code is written using Visual Studio 2010.

The goal of this article is to create a web page that looks like the following image.

The user can click on the Edit link to change the value of the fields.  I'll show you how to complete a drop down list in the row when editing the Title and also how to use the RequiredFieldValidator and the RegularExpressionValidator controls to implement the business rules.  The complete code for this article can be downloaded here.


View Entire Article

User Comments

Title: vb nvvbnvb   
Name: vbnvbn
Date: 2012-06-06 10:09:02 PM
Comment:
vbn
Title: Cant see images   
Name: jrk
Date: 2012-05-25 9:27:32 PM
Comment:
The images in this article show as big red X
Title: great done   
Name: vishwajeet singh
Date: 2010-09-30 6:44:04 AM
Comment:
its realy great thing what happend through .net 4.0

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-26 10:32:15 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search