Editor and Sqlite data provider - 'Unable to find the requested .Net Framework Data Provider'

Editor and Sqlite data provider - 'Unable to find the requested .Net Framework Data Provider'

I've downloaded the evaluation version of the editor. When specifying the DbType as 'sqllite', and trying to run it, the exception I get is 'Unable to find the requested .Net Framework Data Provider'

Setup:
.net
DbType=sqlite
DbConnection=Data Source=C://DMZ//CZ.db;Version=3;

Web.config
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<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" />
</DbProviderFactories>
</system.data>

I've installed following Nuget packages:
Microsoft.Data.Sqlite
System.Data.Sqlite

Note. I've got existing sqlite connection in my app, which is working and i'm using. Event if I pass the existing connection to the edit new Database(settings.DbType, existingConnection), I do get the same exception.

I've also run the Sqlite script against my DB for the sample, and my existing DB, already has tables I'm trying to connect to.

Both sample application and existing application gives same exception:
Unable to find the requested .Net Framework Data Provider

Any help or directions would be welcomed.

Replies

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    You need to register the provider in .NET Core (which wasn't required in .NET Framework since it uses a global extension)

    using Microsoft.Data.Sqlite;
    

    and in Main():

    DbProviderFactories.RegisterFactory("Microsoft.Data.Sqlite", SqliteFactory.Instance);
    

    Allan

  • durairajasivamdurairajasivam Posts: 1Questions: 0Answers: 0

    How to register for Azure SQL

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    Use azure when creating the database connection. The documentation for that is available here.

    Allan

This discussion has been closed.