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.