I was wondering about the use of the .NET entity framework with an embedded database solution. Right now, I only use the EF with SQL Server but for a new project I'm looking for alternate solutions. SQL Server Compact would be one solution, but are there other alternatives that I can use with EF? Preferably solutions that don't require complex installations?
The actual (although not the full one) list of ADO.NET Entity Framework providers is available here.
There is a couple of providers supporting Embedded MySQL - dotConnect for MySQL and MySQL Connector/NET and SQLite - dotConnect for SQLite and System.Data.SQLite.
If there is an EF provider for the embedded database, you should be able to plug it right into EF. Check with your embedded database provider to see if they have support for EF.
Third Party Provider Support for the Entity Frameworkhttp://blogs.msdn.com/adonet/archive/2008/08/11/third-party-provider-support-for-the-entity-framework-rtm.aspx
Related
I am making a very basic program for a friend of mine that will need a very basic DataBase. I will have about 3 tables at max, I was wondering if it is possible to use access database files easily in C# just like a normal SQL database and if so how? I have seen some tutorials using OLEDB but none really give me a clear way to do things.
It doesn't really go with the Access need but i throw this answer based on the OPs' intention to digg into SQLite.
So i would go for SQLite for its simplicity and efficiency.
See these posts on a very fast and easy way to work with SQLite and Entity Framework:
GETTING STARTED, USING SQLITE WITH .NET
USING SQLITE WITH ENTITY FRAMEWORK 6 AND THE REPOSITORY PATTERN
SQLITE WITH ENTITY FRAMEWORK CODE FIRST AND MIGRATION
Entity Framework 5 on SQLite
Portable databases (II): using SQLite with Entity Framework
I am currently working on a legacy project that has DB first ORM
of linq to sql .
How can i use the same DBML file and just channge it to use sqlite connection instead of the SQL-Server connection that is used in production?
You'll need to find a Sql Lite Linq-to-Sql provider. This answer points to one: https://stackoverflow.com/a/459256/736079. Should you want a simple database that is supported out-of-the-box for unit testing purposes, then you can also use SQL Server Compact Edition.
How to organize connection to different database with Entity Framework 4 by means of settings?
For example: one client works with Oracle, another with SQL Server. Database structure is equal. I need setting param to change database type
When using XML-mapping (both Database-First and Model-First approaches) a solution with resource splitting (one CSDL, one MSL, many SSDL) and different connection strings is required. An example of such approach is as follows: EFQuerySamples from Microsoft, illustrating interaction with different SQL Server and SQL Server Compact versions, and its modified version EFQuerySamples from Devart that supports Oracle, MySQL, PostgreSQL and SQLite in addition to SQL Server.
When using fluent mapping (Code-First approach with DbContext utilization) multiple resources are not required, but some peculiarities of certain databases and EF-providers must be taken into account (the absense of the "dbo" schema, etc.). An example of such approach is as follows: Code-First sample for SQL Server, Oracle, MySQL, PostgreSQL and SQLite .
I'm fairly new to LINQ and trying to find a more elegant way (other than ADO.Net) to query and manipulate data in a SQLite database. I'm using System.Data.SQLite and wondering if there is a DataContext class or a way to use DataContext class to work with SQLite.
I believe LINQPad uses the same assembly for its SQLite/MySQL driver and with it I can execute C# expressions like so:
from c in Collection
where c.Length > 3
select c
What can I do to use those same LINQ expressions with my SQLite databases in my applications?
System.Data.SQLite supports the ADO.NET Entity Framework, so you should be able to just add an Entity Framework mapping and point it to your SQLite connection.
http://sqlite.phxsoftware.com/sqlite.wmv
Basically, Linq-to-SQL as is only support SQL Server as its backend.
You need to look at some third-party extension, like:
DBLinq
LinqConnect
Those additional tools allow you to use Linq-to-SQL against a variety of backend database stores, including SQLite.
I'm looking for a third-party Oracle Data Provider for .Net (ADO.NET) with a full support of Oracle object types (like geometries). I was foolish enough to use ODP.NET and now I'm paying the price - it's incredibly buggy and I just reached the end of the line (keep crashing IIS Pool - known issue, no resolution). I found dotConnect which is fine, just 4 times slower with object types than ODP.NET. Are any others providers which support Oracle objects?
As I'm looking into working with Oracle database from C#, here is what I can say as an update to this question.
These are the alternatives:
Microsoft's System.data.OracleClient is part of the .Net framework and requires Oracle Client installed or external dll's (but I think it's not supported anymore)
Oracle Data Provider for .Net (ODP.Net), is the offcial .Net provider from Oracle. I think it is part of Oracle Client install.
Third party Devart dotConnect for Oracle (follow me).
Third party Datadirect ADO.Net provider for Oracle (follow me).
I didn't dig deeper yet, but information is not so easy to find about Oracle connectors, so here is my contribution ;-)
Are you aware of the Oracle-published ADO.net provider ? this dll ships with the Oracle CLient, and is named Oracle.DataAccess.dll. The version I am using is ver 1.102.4.0, and is dtd 2/11/2008.
There is also this provider: http://www.datadirect.com/products/net/net_for_oracle/index.ssp . I don't know whether it supports spatial type mdsys.sdo_geometry.
In the last release Telerik OpenAccess introduced a flexible type mapping system which allows developers to easily work with custom DB types/UDTs. It ships with support for Geometric/Geographic data, and it is easy to create your own type converter to tell OpenAccess how to map any custom types you may have. The type converters work for all DBs OA supports, one of which is Oracle. :)