Editing and Updating Data in Gridview Using Sqldatasource Control - Part 17
Editing and Updating Data in Gridview Using Sqldatasource Control - Part 17
Editing and Updating Data in Gridview Using Sqldatasource Control - Part 17
Sql server, .net and c# video tutorial: Editing and updating data in gridview using sqldatasource control - Part 17
Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD
Suggested Videos
Part 14 - ConflictDetection property of SqlDataSource control
Part 15 - Deleting data from gridview using objectdatasource control Best software training and placements in
Part 16 - ConflictDetection property of objectdatasource control marathahalli, bangalore. For further
details please call 09945699393.
We will be using tblEmployee table for this demo. SQL script to create and populate CPT Tutorial
this table with sample data is available in Part 13 of asp.net gridview tutorial. Part 1 : Video | Text | Slides
Create an asp.net web application. Drag and drop a sqldatasource control and a
Important Videos
gridview control on webform1.aspx.
The Gift of Education
Now flip "WebForm1.aspx" to "HTML Source" mode. Notice that, the wizard has AngularJS Tutorial
automatically generated INSERT, UPDATE and DELETE statements. Since, we only
jQuery Tutorial
want to enable the gridview control to eidt and update data, get rid of InsertCommand,
InsertParameters, DeleteCommand, and DeleteParameters. JavaScript with ASP.NET Tutorial
Now let us associate "SqlDataSource1" control with "GridView1" control JavaScript Tutorial
1. Right click on "GridView1" control and select "Show Smart Tag"
2. Select "SqlDataSource1" from "Choose Data Source" dropdownlist Charts Tutorial
3. Select "Enable Editing" checkbox. At this point "Edit" button should appear on the
gridview control. LINQ
LINQ to SQL
Now run the application. Click "Edit" button. Notice that "Update" and "Cancel"
buttons are displayed, when the row is in EDIT mode. Also, notice that except LINQ to XML
"EmployeeId", all the other columns display a TextBox control, so the user can change
data. By default, bound fields display a textbox control as the editing interface. It makes Entity Framework
more sense to display a dropdownlist control as the editing interface, for "Gender" and
http://csharp-video-tutorials.blogspot.in/2013/03/editing-and-updating-data-in-gridview.html 1/3
8/28/2017 Sql server, .net and c# video tutorial: Editing and updating data in gridview using sqldatasource control - Part 17
"City". We will discuss about doing this in a later video session. WCF
EmployeeId column is the primary key, and it is unusal to change key column values. ASP.NET Web Services
Notice the HTML of the gridview control. The bound column that displays "EmployeeId"
Dot Net Basics
is marked with ReadOnly="True". This is the reason EmployeeId is not editable, when
the row is in EDIT mode. C#
This property need to be set at both places. Visual Studio Tips and Tricks
1. On the BoundField and
2. On the respective update parameter Dot Net Interview Questions
Slides
Entity Framework
WCF
C#
SQL Server
ADO.NET
ASP.NET
GridView
1 comment:
ASP.NET MVC
Job January 28, 2014 at 4:06 AM Visual Studio Tips and Tricks
hello sir
I am getting this type of error. Java Video Tutorials
Part 1 : Video | Text | Slides
Incorrect syntax near 'nvarchar'.
Must declare the scalar variable "@ID".
Part 2 : Video | Text | Slides
how to solve this
Part 3 : Video | Text | Slides
Reply
Interview Questions
C#
Enter your comment...
SQL Server
Written Test
Comment as: Select profile...
Publish Preview
http://csharp-video-tutorials.blogspot.in/2013/03/editing-and-updating-data-in-gridview.html 2/3