Gopal Ji  Singh

Gopal Ji Singh

  • NA
  • 39
  • 31.9k

Update button in datalist....

Jun 24 2013 10:21 AM
i have written a query to update the table but its not updating the table please help me if some buddy can...

 protected void accept1_Click(object sender, EventArgs e)
    {
        con.Open();
       
        Label Label1 = (Label)reqlist.FindControl("Label1");
        SqlCommand cmd=new SqlCommand("update friends set friendstatus='Y' where myid='" +  Label1 + "' AND friendid='" + Session["myid1"] + "'",con);
        cmd.ExecuteNonQuery();
        Response.Write("thanx");
        con.Close();
       
    }



Answers (16)