Hai Friends,
txtname=name
dropdown=class
button=ADD
button= modify
gridview
name class details
ram 2 edit
if i choose edit from gridview ll appear above textboxes when i try to give modify its not working?
paste code here any body tell me what's wrong with that?
protected void Button1_Click(object sender, EventArgs e)
{
string strcon = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(strcon);
conn.Open();
string ht = "update grts set name=@name,class=@class where id=@id";
SqlCommand cmd = new SqlCommand(ht, conn);
// cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add("@status", SqlDbType.VarChar).Value = "update";
cmd.Parameters.AddWithValue("@name", txtname.Text);
cmd.Parameters.AddWithValue("@class", DDL_Class.Text);
cmd.Parameters.AddWithValue("@id", Txtid.Text);
cmd.ExecuteNonQuery();
conn.Close();
binddata();
txtname.Text = "";
DDL_Class.Text = "0";
}