The problem is you are using wrong
MySqlCommand
object when setting parameters for
cmdd
.
These two lines
cmd.Parameters.AddWithValue("@k", HiddenField1.Value);
cmd.Parameters.AddWithValue("@userName", Session["user"].ToString());
should be corrected as
cmdd.Parameters.AddWithValue("@k", HiddenField1.Value);
cmdd.Parameters.AddWithValue("@userName", Session["user"].ToString());
Also you have forgotten this line too
cmdd.ExecuteNonQuery();
Hope this will help to you :-)