0
update syntax is wrong, you can't say SET WHERE..has to be this format :
UPDATE MyTable
SET Columnn1 = somevalue
WHERE Column2 =somevalue
try this :
string sqlUpdate = "UPDATE login SET password='" + txtPass.Text + "' where ID='" + txtID.Text + "'";
0
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=HMS;Integrated Security=True");
if (txtPass.Text == txtConfrmPass.Text)
{
try
{
string sqlUpdate = "UPDATE login SET WHERE password='" + txtPass.Text + "' where ID='"+txtID.Text+"'";
SqlCommand cmdd = new SqlCommand(sqlUpdate, conn);
conn.Open();
cmdd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("successfully updated");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
else
{
MessageBox.Show("retype your new password correctly");
}
0
On submit click call SQL Update query
Update TableName set password="textbox2.text" where emailId="textbox1.text"
Please apply validation for null and record exist in database before this query.
0
you will use SQL Update statement :
http://www.w3schools.com/sql/sql_update.asp
when email is equal to particular email and password is not empty, execute update statement..