Sumit Kumawat

Sumit Kumawat

  • NA
  • 454
  • 414.8k

ERROR [HY000] parameter marker count incorrect (1)

Oct 21 2013 4:24 AM

Hi All,

I am using ODBC connection to connect my SQlite database. its is working fine for insert and delete data but if i am updating any data then i am getting below error.

"ERROR [HY000] parameter marker count incorrect (1)"

here is my query which i am using :

 SQLConnection.Instance.Open();

  OdbcCommand mySQLiteCommand = SQLConnection.Instance._dbCon.CreateCommand();

    mySQLiteCommand.CommandText = "Update  SyncTable set LastTime = @LastTime,Status = @Status Where DisplayName = '" + task.Key + "'and UserName = '" + loginObj.Key + "'";
                    mySQLiteCommand.Parameters.Clear();
                    mySQLiteCommand.Parameters.Add(new OdbcParameter("@LastTime", task.Value as object));
                    mySQLiteCommand.Parameters.Add(new OdbcParameter("@Status", status as object));
                    mySQLiteCommand.ExecuteNonQuery();
                    SQLConnection.Instance.Close();

i am not getting where i am doing wrong.Please help me.

Thanks


Answers (5)