Hi anyone c an help me whats wrong with my code.. Image doest display if the remarks is incorrect in my asp.net page.. check image always display even the remarks is in correct, pls help me.. heres my code, thanks
SqlCon.Open();
SqlCommand sc_quest = new SqlCommand("SELECT * FROM tblApplicantAnswer INNER JOIN tblQuestion ON tblApplicantAnswer.questionId = tblQuestion.questionId AND tblApplicantAnswer.categoryId = tblQuestion.categoryId WHERE tblApplicantAnswer.applicantId
='" + l_appid.Text.ToString() + "' AND tblApplicantAnswer.categoryId=" + l_catid.Text.ToString(), SqlCon);
roxan
Member
116 Points
242 Posts
image doesnt display correctly?
May 12, 2012 02:34 AM|LINK
Hi anyone c an help me whats wrong with my code.. Image doest display if the remarks is incorrect in my asp.net page.. check image always display even the remarks is in correct, pls help me.. heres my code, thanks
SqlCon.Open();
SqlCommand sc_quest = new SqlCommand("SELECT * FROM tblApplicantAnswer INNER JOIN tblQuestion ON tblApplicantAnswer.questionId = tblQuestion.questionId AND tblApplicantAnswer.categoryId = tblQuestion.categoryId WHERE tblApplicantAnswer.applicantId ='" + l_appid.Text.ToString() + "' AND tblApplicantAnswer.categoryId=" + l_catid.Text.ToString(), SqlCon);
SqlDataReader sdr_quest = sc_quest.ExecuteReader();
sc_quest.Dispose();
while (sdr_quest.Read())
{
TableCell tc3 = new TableCell();
tc3.Width = 30;
Label l_remarks = new Label();
l_remarks.Text = sdr_quest["remarks"].ToString();
if (l_remarks.Text == "correct" )
{
Image i_correct = new Image();
i_correct.ImageUrl = "~/images/check.png";
tc3.Controls.Add(i_correct);
}
else
{
Image i_incorrect = new Image();
i_incorrect.ImageUrl = "~/images/cross.png";
tc3.Controls.Add(i_incorrect);
}
tr.Cells.Add(tc3);
tbldynamic.Rows.Add(tr);
p_result.Controls.Add(tbldynamic);
}
whats wrong with my code?