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
Reader Level:

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.

 

Login to add your contents and source code to this article
post comment
     

good example..

Posted by Santosh Yadav Mar 16, 2013

nice post yarr

Posted by karthik reddy Feb 01, 2013

Hi, How we set conditions on records showing in gridview?

Posted by Gaurav Gupta May 08, 2012
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.