Running Visual Studio 2010 on Windows 10
I downloaded and installed sqlite-netFx40-setup-x86-2010-1.0.104.0.exe
My project is set to use .NET Framework 4.0
I added the reference to the System.Data.Sqlite.dll file just downloaded. (I tried it with and without CopyLocal)
I added the following lines in my app.config / system.data / DbProviderfactories section file per the readme file:
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
In any code file, I can add the Imports System.Data.Sqlite command and make a variable of type SQLiteConnection. e.g:
Imports System.Data
Imports System.Data.SQLite
''' <summary>
''' Provides Methods for parsing info from a SQLite
''' </summary>
''' <remarks></remarks>
Public Class ParseSQLite
Public Shared Function GetDatabaseVersion(ConnectionString As String) As String
Dim connection As SQLiteConnection
...
Return ""
End Function
End Class
This works fine with no immediate errors until my first build. I then get the error "Type 'SQLiteConnection' is not defined.
I also looked at another SO Question Adding “System.Data.SQLite” as a reference but it is wasn't relevant since I could add the reference without issue.
Any ideas?
...the System.Data.Sqlite.dll file just downloadedif you add it as a NuGet package, it configures everything in the project for you.System.Data.SQLite.SQLiteConnectionand see if that works. If not, probably an issue with the reference or namespacesCopy LocalisTruefor your reference, so the DLL is available to the compiled EXE.