Error when opening SQLite Connection on C#?

Viewed 878

I'm trying to connect and select data from a SQLite database table but it's showing me this error in con.Open() line:

An unhandled exception of type 'System.AccessViolationException' occurred in SQLite.NET.dll

Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Here's my code:

SQLiteConnection con = new SQLiteConnection("Data Source = db.sqlite; Version=3;");
con.Open();

SQLiteCommand command = new SQLiteCommand("Select * from [user] where login=@login and password=@password", con);

command.Parameters.Add("@login", textBox1.Text);
command.Parameters.Add("@password", textBox2.Text);

I also added reference to SQLite .dll.

What is the cause of this error?

1 Answers
Related