protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
Thread.Sleep(3000);
TextBox name = (TextBox)e.Item.FindControl("TextBox1");
TextBox address = (TextBox)e.Item.FindControl("TextBox2");
Label lbl = (Label)e.Item.FindControl("Label1");
if (e.CommandName == "Edit")
{
int p_id = Convert.ToInt32(e.CommandArgument);
SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=practice;integrated security=true;");
SqlCommand sqlcomm = new SqlCommand("Update persons set p_name='" +name.Text +"' , p_address='" + address.Text + "' where p_id='" + p_id + "'", sqlconn);
sqlconn.Open();
sqlcomm.ExecuteNonQuery();
sqlconn.Close();
lbl.Text = "Updated";
}
}
If(!IsPostBack)
{
Bind();
}