I am trying to use SQLite in a C# app but I have a problem:
I followed this guide: http://ift.tt/1tjapqz
And my code is:
namespace MyDB
{
internal class SQLiteConnector_Local
{
private SQLiteConnection m_dbConnection;
public SQLiteConnector_Local() {
SQLiteConnection.CreateFile("MyDatabase.sqlite");
m_dbConnection = new SQLiteConnection("Data Source=MyDatabase.sqlite;Version=3;");
m_dbConnection.Open();
SQLiteCommand command = new SQLiteCommand("CREATE TABLE IF NOT EXISTS singleOptions (key_column VARCHAR(50), value_column VARCHAR(80))", m_dbConnection);
command.ExecuteNonQuery();
m_dbConnection.Close();
}
}
}
I have an Exception on the line:
m_dbConnection.Open();
The exception is:
An exception of type 'System.AccessViolationException' occurred in System.Data.SQLite.dll but was not handled in user code.
Yes, the exception must be handled, but my main problem is why I have this exception?
I searched the solution in others questions but I have not found it.
Aucun commentaire:
Enregistrer un commentaire