string sid = Session["id"].ToString();
string q1, q2;
q1 = "select count (*) from All_msg where target_id = '" + sid + "'";
SqlCommand cmd1 = new SqlCommand(q1, cn);
int v1;
v1 = (int)cmd1.ExecuteScalar();
q2 = "select count (*) from All_msg where target_id = '" + sid + "'";
SqlCommand cmd2 = new SqlCommand(q2, cn);
SqlDataReader rdr1 = cmd2.ExecuteReader();
while (rdr1.Read())
{
if (rdr1.HasRows)
{
TableRow tr1 = new TableRow();
TableCell t1 = new TableCell();
string s1 = Convert.ToString(rdr1["id"]);
t1.Text = s1 ;
tr1.Cells.Add(t1);
What Should I do?