Gridview rowupdating commandname
To String(); Sql Connection con = new Sql Connection("Data Source=STD-258E51EA446\SQLEXPRESS; Initial Catalog=Employee; Integrated Security=True"); Sql Command cmd = new Sql Command("update emp set name='" Text Box1. Find Control("Text Box7"); Text Box txtdesg = (Text Box)Grid View1. Major concern with any data entry form is Add, Edit, Delete and View.
Instead if you are using default Delete Button of Grid View then register for Row Deleting event of Grid View and for accessing Unique ID columnvalue from database you need to fetch the id from Data Keys collection of Grid View. By default Edit Index of gridview is -1 (Normal mode). Find Control(“txt Designation”) as Text Box; Finally update the row and refresh the grid. Find Control("Text Box8"); Text Box txtsal = (Text Box)Grid View1. Find Control("Text Box9"); Text Box txtcity = (Text Box)Grid View1. Set the data bindings for Delete Button for Command Argument Eval(“Emp Id”); for saving the ID column value from database for fetching the ID field value while Deleting the Record.Set the Command Name property to Delete Button to CMDDelete. Value); Place the Textbox control in the grids Footer template for Adding new record. Register events for Edit, Update, Cancel button of gridview ?? View in Grid View To view data in gridview is very simple. Ts Fill method and set the Grid Views Data Source Property to Data Set.