0

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?

3
  • ...the System.Data.Sqlite.dll file just downloaded if you add it as a NuGet package, it configures everything in the project for you. Commented Jan 30, 2017 at 23:54
  • First try using a fully qualified class name System.Data.SQLite.SQLiteConnection and see if that works. If not, probably an issue with the reference or namespaces Commented Jan 31, 2017 at 3:54
  • Also ensure Copy Local is True for your reference, so the DLL is available to the compiled EXE. Commented Jan 31, 2017 at 3:55

1 Answer 1

1

that don't work anymore(or it has a bug), the only way i found is via NUget. VS 2010 NUGET

you can read here on installing NUGet: https://learn.microsoft.com/en-us/nuget/guides/install-nuget

scroll down until you see the "NuGet Package Manager in Visual Studio"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.