SQLite in memory with dapper generates non-existent table error

0

I have the following code for creating the table:

            string query = @"CREATE TABLE GVP_USERS_TAGS(
                            ID integer NOT NULL PRIMARY KEY AUTOINCREMENT,
                            DATEINS datetime NOT NULL DEFAULT (DATETIME('now')),
                            NAME varchar(250) NOT NULL,
                            OWNER integer NOT NULL,
                            USER_ID integer NOT NULL,
                            PRODUCT_ID integer NOT NULL,
                            TYPE_ID integer NOT NULL,
                            VALUE varchar(250) NOT NULL,
                            PRODUCT_TYPE_ID integer NOT NULL,
                            Updated_Row timestamp NOT NULL,
                            MOVIE_TYPE_ID integer NOT NULL DEFAULT 0,
                            PIN_REQUIRED integer NOT NULL DEFAULT 0
                        )";
        return await queryExecutor.ExecuteAsync(query);

Then I use the following code:

var countQuery = $"SELECT COUNT(*) AS [Count] FROM GVP_USERS_TAGS NOLOCK {where}";
int count = await queryExecutor.ExecuteScalarAsync<int>(countQuery, parameters);

the following exception is thrown:

SQL logic error\r\nno such table: GVP_USERS_TAGS\

detail when using in filesystem works.

    
asked by anonymous 18.05.2018 / 22:35

1 answer

0

I was able to resolve using _connection.Open(); .

    
19.05.2018 / 20:38