It is very difficult for me to use SQLite db with EF CTP5. I was just trying to run this MSDN example using SQLite. But on the line
var food = db.Categories.Find("FOOD");
I get an exception at runtime:
System.Data.SQLite.SQLiteException (0x80004005): SQLite errorno this table: Categories
Note. The app.config file must be modified and looks like this:
App.config
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<generatePublisherEvidence enabled="false" />
</runtime>
<system.data>
<DbProviderFactories>
<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.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="ProductContext" connectionString="Data Source=D:\CodeFirst.db;Version=3;New=True;" providerName="System.Data.SQLite" />
</connectionStrings>
</configuration>
source
share