and this simple query

but I get the error “Table LastLogin doesn’t exist”

I have used SqLitein .Net already but it’s the first time I’m using it in Asp.Net,I’m sure the table exists but it seems it can connect to it, where is my problem? is the setting in web.config is enough? is there any tutorial available ? thanks

————————————————-

Answer

Verify if the table(s) exist in your SQLite db using the GetSchema method:

using ( var conn = new SQLiteConnection( "Data Source=<PathToDb>MembersLastLogin3.s3db" ) )
{
DataTable tbl = conn.GetSchema("Tables")
// The DataTable will list all the tables in the
// db as well as information about each table.
}

The most likely cause is the connection string you are using is not pointing to the SQLite database which is why you’ll see the error table does not exist.

As a side note regarding the sample code you posted, if you are not doing anything with the exception, then there is no need to try/catch the exception if the exception is just going to be thrown back.