Thank you for your emails .I am very grateful to your emails.They help me
post more blogs even i am very busy debug codes.
Take a good look at this grid:
What if i want to update Documents table with this statement:
Update Documents SET Status='Active' WHERE DocumentID=Current selected row on gridview!!!!(Remember Document is a SQL Keyword)
Here are the easy way to do it(VB.NET):
Step1: fire RowCommand event from Gridview( ex GridView1_RowCommand ...Handles GridView1.RowCommand)
Step2: Use CommandName and CommandArgument properties
Ex commandname are :Edit,Update,Delete,Insert....
commandargument is used to find the primary key of currently select item on gridview
Here is the code within GridView1_RowCommand :
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
Dim itm As Integer
If e.CommandName.Equals("Edit") Then
itm = Convert.ToInt32(e.CommandArgument) REM get primary key of selected row on gridview
REM your code goes here.Update() is a function with parameter named itm.
It goals is to update Documents table based on selected row on the grid.
That`s all i want to share with you today.
Any question or if you want private training a lower cost please send
me email at firstname.lastname@example.org
.Net Developer(VB.NET,C#,PHP,ASP.NET 2.0/3.5)
- CRUD operations with LINQ To SQL(ASP.NET 3.5)
- Do you know the Best developers IDE?
- Do you know which version of AJAX Toolkit to use f...
- XScheduler will be release end September 2009 ea...
- How to get the current Primary Key from GridView(A...
- New To LINQ To SQL?Watch this video
- Introduction to Windows Live Cloud Services
- How to bind XML Data to GridView or DataGrid?
- Free HTML control for your VS 2005/2008 Projects
- How to configure Visual Studio 2005/2008 to use En...
- How to Enable Administrator Account on Vista
- Best VB.NET 2005/2008 Books
- SQL Server 2005 Authentication
- Solution to this error:Maximum stored procedure, f...
- How to hack "Failed to query a list of database na...
- How to color a row of DataGrid in ASP.NET 2.0/3.5...
- ▼ August (18)
- Raleigh, NC, United States