Gridview1rowupdating datatable

Posted by / 23-Jul-2017 17:44

Drag and drop a Grid View control, two Link Button controls, two Text Box controls and a Panel control into Data From Data page.In this demo, I presumed that you already have a basic background on how to create a simple database table.

Step 4: Please press Ctrl F5 to show Data In page, the test steps just like Data From Data Add "Person" table with three fields "Person ID","First Name","Last Name", Person ID is the primary key of the table, and you can insert some default values in Person table.The Update Or Add New Record is a method that takes seven parameters.Six of those parameters basically come from the Text Box values that were entered in the page.In case of the bound field’s we need to check what column it is and need to use index of that cloumn, which is little hard and even in future if we change the column order If you see the Last Template Field part in the above code, I am using the link buttons for edit, update, delete and cancel.May be you may think why am I using link buttons as we are provided with some command field buttons by Grid View.

gridview1rowupdating datatable-70gridview1rowupdating datatable-28gridview1rowupdating datatable-55

In this example, I used my own database called Sample DB which has Customers Table and basically contains the following field columns: As you have noticed in STEP 2, we have added six Text Box and a Button in the web form in order for us to type the information there and Insert them to the database.