Perform Operations in GridView Without Using Coding in ASP.NET
How to perform edit, update, delete, cancel and sorting operations in GridView without using coding in ASP.Net
In this article I explain how to perform various operations like edit, update, delete and cancel in a GridView without using coding in ASP.Net. This article shows you how the database is connected with the GridView and performs the various operations. GridView is used to store the data. It is a control of Data Controls in ASP.Net. The following steps shows you how this will work.
Step 1: First create the database in SQL; give the name of the database as db and table name as employee; insert some values in this table, like this:
Step 2: Now open the Visual Studio by clicking file->new->website->select the ASP.Net website.
Step 3: In the design view add a GridView control from the data controls.
Step 4: Select New Data Sources from the GridView.
Step 5: A window appears from which select the database (SQL) like this:
Step 6: A window appears; after clicking the database, from this window select the new connection, then another window is opened like this:
Step 7: Now enter the Server name; select the authentication, whether it is a window or a server and give the username and password in the case of server authentication, and click on the "Test Connection as" button.
Step 8: Now after clicking ok, the database is saved; click next then click on the advanced options as:
Step 9: Select both the check boxes and click ok then click on next and finish; now the database is attached with your GridView control.
Step 10: Now select on the checkboxes; that is, enable paging, sorting, editing and deleting like this:
Step 11: Now run the applicatiopn by pressing F5 and the output is as:
Step 12: Perform an edit operation in this, so that after performing the editing the update link is clicked so the data is now updated.
Summary: In this article I explain how we perform operation in GridView without using coding.