Asp.net gridview search using sql server and update results

1. Create Database in Sql Server for Asp.net gridview search
Database Name: GridDB
TableName: tblStudent
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.
asp.net 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.

output1

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

output2

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.

output3

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

Suresh Kumar A

Suresh Kumar is a Sr. Software Engineer since 2010. He has 4+ years of experience in Microsoft technologies. He is expert in windows platform both for web and device. Had worked in several projects. I am a quick learner and like to research, innovate and would live to give write tips and tricks or articles.

More Posts

Leave a Comment

Your email address will not be published. Required fields are marked *