gridview search using sql server and update results

1. Create Database in Sql Server for gridview search
Database Name: GridDB
TableName: tblStudent
From above table structure, status represents 0 and 1. 0 indicates fail and 1 indicates success. It means registration is failed or success,Add few dummy records into the table with status “0”.

2.Create .Net Empty Web Project
Project Name: GridViewSearchDemo. gridviewsearch
Project contains three types of files
a) Class file(Processor.cs)
b) Web.config
c) Web form i.e., frmGridSearch.aspx

In this project, we will do three operations.
• Search the records based on Name, Mobile No, Date and Status
• Update the mobile number of successfully registered students from grid
• Updating the registration status by using resend button.

Before going to design the page, we will implement the business logic for the above operations.
a) Processor.cs : Used for business logic for three operations.
Below is the code for business logic.

b)Web.config: create config file to create connection string to communicate with database,check below code once to get better idea.

c)Web form i.e., frmGridSearch.aspx
Web page frmGridSearch.aspx has design(.aspx) page and code behind file(.aspx.cs)
Below code for design the web page i.e., frmGridSearch.aspx

html  view

Code for the events for this page is below.

After completion of coding. Build and run the application.


Search button: will search the records based on the input provided.
Reset button: will clears all the fields.


Clicking on resend will update the status as success, the record will be displayed in success list.
You can update the mobile number of successfully registered students by clicking on “Change Mobile No” button.


Thanks for reading this article ,for any queries please use comment system.

One Response

  1. Giselle Little November 12, 2018

Leave a Reply