Monday, March 30, 2020
Sunday, March 22, 2020
Saturday, March 31, 2018
- Install Toolbox
- Install SQLite in GAC
- Install SQLite EF provider in project
- Run EDM Wizard
Select "Full Installation"
Select: Install the assemblies into the global assembly cache - Install VS designer components
Restart Visual Studio
Verify that the EF6 provider is installed in GAC from the Toolbox "About" dialog:
If the EF6 provider is not in GAC, this may be due to an invalid entry in machine.config, located in the C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config folder. The only SQLite related entry should look like this, with this exact version number:
<system.data> <DbProviderFactories> <add name="SQLite Data Provider" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6, Version=126.96.36.199, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data>
Make sure to install the same version as the tools package above.
PM> Install-Package System.Data.SQLite
Packages.config should look like this after install:
<packages> <package id="EntityFramework" version="6.2.0" targetFramework="net461" /> <package id="System.Data.SQLite" version="188.8.131.52" targetFramework="net461" /> <package id="System.Data.SQLite.Core" version="184.108.40.206" targetFramework="net461" /> <package id="System.Data.SQLite.EF6" version="220.127.116.11" targetFramework="net461" /> <package id="System.Data.SQLite.Linq" version="18.104.22.168" targetFramework="net461" /> </packages>
<configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <entityFramework> <providers> <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> </providers> </entityFramework> <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" /> </DbProviderFactories> </system.data> </configuration>
Use "SQLite Provider (Simple for EF6 by ErikEJ)" when creating a connection to your SQLite database file.
Wednesday, January 4, 2017
A number of developers are still, in 2017, developing new solutions for Windows CE / Windows Mobile using Visual Studio 2008 and SQL Server Compact 3.5 SP2. Unfortunately, Microsoft has removed the official download of the SQL CE 3.5 SP2 package for devices, which contains the cab files for installing the SQL CE runtime on various processor flavors of Windows CE / Windows Mobile and also contains a cab file for installing a System.Data.SqlClient (ADO.NET provider for SQL Server), that allows you to access SQL Server directly from a Windows Mobile device.
In this blog post I will describe the steps required to get the Device MSI installed on your development PC. Luckily, it is still currently possible to request the latest updates/hotfixes of the 3.5 SP2 runtime – I have a comprehensive list here.
We can take advantage of the fact, that each “patch” is essentailly a full release of all applicable packages, and that build 8109 is a full re-release of all possible packages.
1: Navigate to the KB page for hotfix 8109: https://support.microsoft.com/en-us/kb/2860310
2: Click the “Hotfix Download Available” link (blue button)
3: Accept the license agreemnt if prompted
4: Expand the list of hotfixes to show all 52 packages by clicking the link “Show hotfixes for all platforms and languages” (this text may be localized)
5: Select (put a checkmark next to) the file named: SSCEDeviceRuntime_ENU
6: Enter your email twice, and press the “Request hotfix” button (button text may be localized)
7: You will now receive an email with a link to the hotfix, download the linked file, named: 465553_ENU_ce_zip.exe
8: Double click the file, and extract it’s compressed contents:
9: Double click SSCEDeviceRuntime-ENU.msi to install the Devices SDK:
10: Complete the setup, the cab files are now present in the C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Devices folder
Wednesday, December 14, 2016
This is a list of some of the available Entity Framework Core extensions out there that expand the functionality of the Entity Framework Core runtime. Only libraries that extend DbContext or similar are included, and they must be published on NuGet.org.
The EF team has lists of third party EF Core providers here: https://docs.microsoft.com/en-us/ef/core/providers/
For a similar list of EF 6.x extensions, see my blog post here
Please let me know if I have missed anything, and I will add it to the list.
Entity Framework Core Second Level Caching Library.
Second level caching is a query cache. The results of EF commands will be stored in the cache, so that the same EF commands will retrieve their data from the cache rather than executing them against the database again.
Loads and saves entire detached entity graphs (the entity with their child entities and lists). Inspired by GraphDiff. The idea is also add some plugins to simplificate some repetitive tasks, like auditing and pagination.
Install-Package EntityFrameworkCore.Detached –Pre
Add triggers to your entities with insert, update, and delete events. There are three events for each: before, after, and upon failure.
Reactive extension wrappers for hot observables of Entity Framework entities.
Retrieve the primary key (including composite keys) from any entity as a dictionary.
Get typed access to the
OriginalValues of your entity properties. Simple and complex properties are supported, navigation/collections are not.
Attempt to capture some good or best practices in an API that supports testing – including a small framework to scan for N+1 queries
Sunday, August 28, 2016
Since may last post in February, as few things have happended in the world of Microsoft Data Acces Development:
Entity Framework Core 1.0 has been released at the end of May, including the providers for SQL Server Compact 4.0 and 3.5 (supplied by yours truly). I plan to blog in more detail about using EF Core with this new provider.
SQL Server 2016 was released, many highlights and improvements to the relational engiene, as highlighted in the “It just runs faster” blog series.
And SQL Server 2016 Developer Edition is now free (was 50 USD earlier)!
Friday, February 12, 2016
I was recently made aware that a hotfix for SQL Server Compact was made available in 2014 – but better late than never.
The hotfix can be requested via the Microsoft support knowledgebase here: https://support.microsoft.com/en-us/kb/2960153
The file/build version of the hotfix is: 4.0.8902.0 (The .NET assembly version stays at either 126.96.36.199 (or 188.8.131.52 for the “Private” .NET Assembly)
The hotfix includes the following fixes:
FIX: Unexpected ordering when you run ORDER BY statement on a column that contains "-" in SQL Server Compact 4.0
FIX: "ConnectionString cannot be null" when you use folder redirection with offline files
FIX: It takes longer time than flush interval to flush committed transactions in SQL Server Compact 4.0