16
Reply

Update button in datalist....

Gopal Ji  Singh

Gopal Ji Singh

Jun 24 2013 10:21 AM
1.3k
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)