Hi Indradeo,
Please change your btn_update_Click Event code with below modified code.
Code
protected void btn_update_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "update emp_mast1 set Password=@Password where emp_id=@Id";
com = new SqlCommand(str, con);
com.Parameters.Add(new SqlParameter("@Password", SqlDbType.VarChar, 50));
com.Parameters["@Password"].Value = txt_cpassword.Text.Trim();
com.Parameters.Add(new SqlParameter("@Id", SqlDbType.VarChar, 50));
com.Parameters["@Id"].Value = Label2.Text.Trim();
int rowsAffected = com.ExecuteNonQuery();
con.Close();
if (rowsAffected > 0)
{
lbl_msg.Text = "Password changed Successfully";
}
else
{
lbl_msg.Text = "Please enter correct Current password";
}
}