protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { string AID = GridView1.SelectedRow.Cells[1].Text; Response.Redirect("Daily Attendance.aspx?AID=" + AID); } on another page i am using this query on page loading protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String mycon = ("Data Source=DESKTOP-5PJ76B9;Integrated Security=SSPI;Initial Catalog=Institute"); String myquery = "Select AID,Datetime,Outdt,Day,Days,OT,Code from HR3 where AID=" + Request.QueryString["AID"]; SqlConnection con = new SqlConnection(mycon); SqlCommand cmd = new SqlCommand(); cmd.CommandText = myquery; cmd.Connection = con; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { TBID.Text = ds.Tables[0].Rows[0]["AID"].ToString(); //TBEN.Text = ds.Tables[0].Rows[0]["EmployeeName"].ToString(); TBIN.Text = ds.Tables[0].Rows[0]["Datetime"].ToString(); TBOut.Text = ds.Tables[0].Rows[0]["Outdt"].ToString(); TBHrs.Text = ds.Tables[0].Rows[0]["Day"].ToString(); TBDay.Text = ds.Tables[0].Rows[0]["Days"].ToString(); TBOT.Text = ds.Tables[0].Rows[0]["OT"].ToString(); TBEID.Text = ds.Tables[0].Rows[0]["Code"].ToString(); } con.Close();
String myquery = "Select AID,Datetime,Outdt,Day,Days,OT,Code from HR3 where AID=" + Request.QueryString["AID"];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)