Click here to Skip to main content
15,891,762 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir ,
iam using asp.net3.5 with c# with sql server 2005.
iam having employee table which contains the following fields


empno int primary key
empname varchar(25)
empmail varchar(25)
city varchar(25)
street varchar(25)
flatno varchar(25)

mobileno varchar(25)

iam displaying all fields from database in a gridview.

in a gridview the last column is a tempalte field which contains link button .

when i click this button update.aspx page is opened .and at the page load event i have to display the selected record fields based on a empno column.

can you give me example so i can get idea.
Posted

you have to pass the empno as querystring to update.aspx. in update.aspx page load get data from db based on empid and display the content
 
Share this answer
 
1-One way to resolve this issue is to append empno as a query string against that link button as

C#
lnkbtn. Postbackurl = "update.aspx?empno" + empno

in the GridView.
2-on the Update.aspx page get that parameter from Query string as

C#
int empno = convert.toInt32(Request.QueryString["empno"]

3- pass that empno to the sql query or any other database ur using and got the desired result against that empno.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900