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 dbconnection; public DAOConexion (string directory) { this.dbconnection = new SQLiteConnection(@"Data Source=" + directory + ";Version=3;"); } public void Connect() { dbconnection.Open(); } public bool doInsert(string sql) { //Create and run the query SQLiteCommand sqlcommand = new SQLiteCommand(sql, dbconnection); if (sqlcommand.ExecuteNonQuery() > 1) { sqlcommand.Dispose(); return false; } else { sqlcommand.Dispose(); return true; } }
The implementation that I am using as a test 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 it's throwing me
sqlite error
no such table: Request
The table is created and if I use the same query in the database it works.
It was a DDL error, the solution was to download another version of the DLL and insert it into the project
Check the schema, it may be consulted in another schema, try:
INSERT INTO DB_NAME.Request...