6
Reply

Missing semicolon (;) at end of SQL statement

Nel

Nel

Oct 19 2011 4:38 AM
2.9k
Hello,

I have delete function and it doesn't function. I got this error:
"Missing semicolon (;) at end of SQL statement." even though I have a semicolon sign at the end of that statement.

Here is my code:
try
  {
  OleDbCommand commandbrisi = new OleDbCommand();
  commandbrisi.CommandText = "Delete from Kazneti where Imeprezime = ? and Adresa = ? order by Rbr asc";
  commandbrisi.Parameters.AddWithValue("@imeprez", txtImePrez.Text);
  commandbrisi.Parameters.AddWithValue("@adresa", txtAdresa.Text);
  commandbrisi.Connection = conn;
  conn.Open();
 
  OleDbDataAdapter oleDBDataAdapter1 = new OleDbDataAdapter(new OleDbCommand("Update * from Kazneti", conn));

  commandbrisi.ExecuteNonQuery();//here is the error

  _dataset.Clear();
  oleDBDataAdapter1.Fill(_dataset, "Kazneti");
  }

  finally
  {
  conn.Close(); 
  } 

Answers (6)