Please help i always get Syntax error in UPDATE statement Error when running this.
Using connection2 As New OleDbConnection(connectionString1)
connection2.Open()
Dim mycmd As New OleDbCommand("UPDATE Users SET password = '" + TextBox2.Text + "', Name = '" + TextBox3.Text + "' WHERE user = '" + TextBox1.Text + "'", connection2)
' Create the Command and Parameter objects.
mycmd.ExecuteNonQuery()
MessageBox.Show("User Successfully Updated!", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
DataGridView1.Rows.Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
connection2.Close()
End Using
Thanks in advance!!
Using connection2 As New OleDbConnection(connectionString1)
connection2.Open()
Dim mycmd As New OleDbCommand("UPDATE Users SET password = '" + TextBox2.Text + "', Name = '" + TextBox3.Text + "' WHERE user = '" + TextBox1.Text + "'", connection2)
' Create the Command and Parameter objects.
mycmd.ExecuteNonQuery()
MessageBox.Show("User Successfully Updated!", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
DataGridView1.Rows.Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
connection2.Close()
End Using
Thanks in advance!!