View Single Post
  #26 (permalink)  
Old 09-22-2007, 05:54 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: C# .Net Tips & Tricks

Hi,
This is the simple way to update single row of record with button in gridview..

GridViewRow gvr;
string gvDataKey;

gvr = GridView1.Rows(e.CommandArgument)
gvDataKey = gvr.Cells(1).Text


sqlStr = "UPDATE tblUser SET uActive = 1 WHERE uPrimaryId = " + gvDataKey + ""

Thanks..

S.Balasubramanian..
Reply With Quote