简体   繁体   English

如何首先为SQLite代码配置Devart dotConnect?

[英]How Configure Devart dotConnect for SQLite Code First?

Can anyone configure the following sample code ? 任何人都可以配置以下示例代码吗? When I run the following code, I get the error : 当我运行以下代码时,出现错误:

No Entity Framework provider found for the ADO.NET provider with invariant name 'Devart.Data.SQLite' 未找到具有不变名称“ Devart.Data.SQLite”的ADO.NET提供程序的实体框架提供程序

Setting in Machine.config 在Machine.config中设置

<system.data>
    <DbProviderFactories>
      <add name="dotConnect for SQLite" invariant="Devart.Data.SQLite"
        description="Devart dotConnect for SQLite" type="Devart.Data.SQLite.SQLiteProviderFactory, Devart.Data.SQLite, Version=4.6.287.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>

after add below block code in app.config 在app.config中添加以下块代码后

<?xml version="1.0"?>
<configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.SQLite" type="Devart.Data.SQLite.Entity.SQLiteEntityProviderServices, Devart.Data.SQLite.Entity, Version=4.6.287.0, Culture=neutral, PublicKeyToken=09af7300eec23701" >
        <migrationSqlGenerator type="Devart.Data.SQLite.Entity.Migrations.SQLiteEntityMigrationSqlGenerator, Devart.Data.SQLite.Entity, Version=4.6.287.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      </provider>
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.SQLite" />
      <add name="dotConnect for SQLite" invariant="Devart.Data.SQLite" description="Devart dotConnect for SQLite"
       type="Devart.Data.SQLite.SQLiteProviderFactory, Devart.Data.SQLite, Version=4.6.287.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
  <connectionStrings>
    <add name="myContext" connectionString="Data Source=l:\newDB.db3;Version=3;" providerName="Devart.Data.SQLite" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>

following error occurs 发生以下错误

The type initializer for 'EFCodeFirst.MySQLiteContext' threw an exception. “ EFCodeFirst.MySQLiteContext”的类型初始值设定项引发了异常。

Download Sample Code : 下载示例代码:

Download 下载


INFO : 信息:

Devart SQLite Code First (dotConnect for SQLite 4.6.287) Devart SQLite代码优先(适用于SQLite 4.6.287的dotConnect)

Entity Framework 6 实体框架6

VS 2013 Preview VS 2013预览

我们已经在dotConnect for SQLite论坛上回答了您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法查询 sqlite 的 devart dotconnect 中的数据 - cannot query for data in devart dotconnect for sqlite 使用 Entity Framework Code First 连接到带有 devart dotconnect 的旧版 Oracle 数据库 - Using Entity Framework Code First to connect to Legacy Oracle Database with devart dotconnect 如何在DevArt PostgreSql dotConnect中处理复合类型参数 - How to deal with composite type arguments at DevArt PostgreSql dotConnect 如何使用 Devart dotConnect Express MySQL 获得 MySQL 时间分数? - How to get MySQL time fraction with Devart dotConnect Express MySQL? 如何首先使用DotConnect For PostgreSQL和实体框架代码 - How to use DotConnect For PostgreSQL and entity framework code first 使用devart dotConnect调用Oracle存储过程 - Call Oracle stored procedures using devart dotConnect Devart dotconnect-有没有办法强制提交顺序? - Devart dotconnect - Is there a way to force the commit order? 使用Benchmark.NET + DevArt dotConnect for PostgreSQL的许可错误 - License error using Benchmark.NET + DevArt dotConnect for PostgreSQL 如何使用依赖注入配置 Devart LinqConnect 数据库上下文 - How to configure the Devart LinqConnect Database Context with Dependency Injection DevArt dotConnect for Oracle在EF 4.0字符串上具有奇怪的行为 - DevArt dotConnect for Oracle with strange behavior on strings with EF 4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM