string final= "select a.Stud_Name,b.Stu_PRN,b.Exam_Year,b.Semister_ID,b.Subject_ID,c.Sub_Name,b.Result,b.Status from Student_Master a join Result_Master b on a.Stud_PRN = b.Stu_PRN join Subject_Master c on c.Sub_ID = b.Subject_ID where b.Stu_PRN='" + TextBox1.Text +"' ";
SqlCommand cmd = new SqlCommand(final,con);
con.Open();
SqlDataReader ids = cmd.ExecuteReader();
//SqlDataAdapter sda = new SqlDataAdapter();
//cmd.Connection = con;
//sda.SelectCommand = cmd;
while (ids.Read())
{
Session["Name"] = ids.GetString(0);
Session["PRN"] = ids.GetValue(1);
Session["Year"] = ids.GetValue(2);
Session["Semister"] = ids.GetValue(3);
//Session["Sub_ID" + i] = ids.GetValue(4);
//Session["Sub_Name"] = ids.GetString(5);
//Session["Result"] = ids.GetValue(6);
//Session["Status"] = ids.GetString(7);
Response.Redirect("FinalResult.aspx");
}
}
}
I want to store entire column of Sub_ID,Sub_Name,Result and status in session
after storing this the display it in the single gridview on another web page
Nishant MittalRank #692 · 3.5K reputationPosted May 2, 2016, 10:21 PM EDT
Vaibhav Solaskar35 reputationPosted May 2, 2016, 10:24 PM EDT
Nishant MittalRank #692 · 3.5K reputationPosted May 2, 2016, 10:24 PM EDT
Nishant MittalRank #692 · 3.5K reputationPosted May 2, 2016, 10:29 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts