none
SQL logic error or missing database Insufficient parameters supplied to the command. RRS feed

  • Question

  • Hi all,

    Through my app i am storing users information in Sqlite database.In database table i have one field which datatype is "Date". while updating Fields in table i am getting following error

    "SQL logic error or missing database Insufficient parameters supplied to the command"

    below in code which i am using.

    mySQLiteCommand.CommandText = "Update  Users set LastDate = @LastDate ,Status = @Status Where Name = '" + item.Key + "'and LastName = '" + item1.Key + "'";

     

     mySQLiteCommand.Parameters.Add(new SQLiteParameter("@LastDate ",object)item.Value));
     mySQLiteCommand.Parameters.Add(new SQLiteParameter("@Status", (object)status));
      mySQLiteCommand.ExecuteNonQuery();

     SQLConnection.Instance.Close();

    Please help me

    Thanks


    sumitk

    Wednesday, June 12, 2013 12:56 PM

Answers

  • Hi All,

    I found solution myself.i forgot to clear parameter so i added like below.

    mySQLiteCommand.Parameters.Clear();



    sumitk

    • Marked as answer by Sumitk.cdac Thursday, June 13, 2013 10:32 AM
    Thursday, June 13, 2013 10:32 AM

All replies