Reader Level:
ARTICLE

Perform Operations in GridView Without Using Coding in ASP.NET

Posted by Richa Garg Articles | ASP.NET Programming May 07, 2012
How to perform edit, update, delete, cancel and sorting operations in GridView without using coding in ASP.Net
  • 0
  • 0
  • 9252

INTRODUCTION:

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:

sql_data.jpg

Step 2: Now open the Visual Studio by clicking file->new->website->select the ASP.Net website.

open_new.jpg

Step 3: In the design view add a GridView control from the data controls.

Clipboard02.jpg

Step 4: Select New Data Sources from the GridView.

new_daata_source.jpg

Step 5: A window appears from which select the database (SQL) like this:

database.jpg

Step 6: A window appears; after clicking the database, from this window select the new connection, then another window is opened like this:

add.jpg

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.

  test_connection.jpg

Step 8: Now after clicking ok, the database is saved; click next then click on the advanced options as:

advanced.jpg

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:

paging.jpg

Step 11:
Now run the applicatiopn by pressing F5 and the output is as:

output.jpg

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.

edit.jpg

Summary:
In this article I explain how we perform operation in GridView without using coding.

 

COMMENT USING

Trending up