Query C # a SQLITE

2

I have the following Database

CREATE TABLE [Request] (
[IDRequest] INTEGER  PRIMARY KEY NOT NULL,
[RequestID] VARCHAR(10)  NULL,
[ReceivedDate] VARCHAR(20)  NULL,
[RequestStatus] VARCHAR(20)  NULL,
[ExpirationStatus] VARCHAR(15)  NULL,
[ResponseStatus] VARCHAR(20)  NULL,
[StatusMessage] VARCHAR(20)  NULL
)

To connect I use the following

private SQLiteConnection conexionBD;


        public DAOConexion (string directorio)
        {
            this.conexionBD = new SQLiteConnection(@"Data Source=" + directorio + ";Version=3;");
        }


        public void Conectar()
        {
            conexionBD.Open();
        }

        public bool doInsert(string sql)
        {
            //Creo y corro la consulta
            SQLiteCommand sqlcommand = new SQLiteCommand(sql, conexionBD);

            if (sqlcommand.ExecuteNonQuery() > 1)
            {
                sqlcommand.Dispose();
                return false;
            }
            else
            {
                sqlcommand.Dispose();
                return true;
            }
        }

The implementation that I am using test mode is the following

conBD.doInsert ("INSERT INTO Request (RequestID, ReceivedDate, RequestStatus, ExpirationStatus ,ResponseStatus, StatusMessage)VALUES ('1', 'asd', '32', 'California', '20000.00','sadsa' );");

The problem is that he is throwing me

  

SQLite error

     

no such table: Request

The table is created and if I use the same query in the database it works.

    
asked by Alejandro Ricotti 04.08.2016 в 22:24
source

2 answers

0

It was a DDL error, the solution was to download another version of the DLL and insert it into the project

    
answered by 19.09.2016 / 22:05
source
0

Check the schema, you may be consulted in another schema, try:

INSERT INTO NAME_DB.Request ...

    
answered by 04.08.2016 в 23:13