I'm kind of new using LINQ to SQL and when ever I try to use a non sql server dbs I get an error that it is an unsupported data provider. Is there a way to get LINQ to work with dbs like Oracle and SQL sdf files?
In order to use LINQ to communicate with a given DB backend, you need to get a DB specific provider. For oracle, try the following project on codeplex
http://www.codeplex.com/LinqToOracle
The DbLinq project supports all of Linq to Sql's features over MySQL, PostgreSQL, Oracle and SQLite, as well as some unique features. It is also the base of Mono's implementation of Linq to Sql.
Not officially, but there are a variety of projects implementing LINQ to SQL for other databases, for example: http://www.codeplex.com/LinqToOracle
Although you specified LINQ to SQL you might also want to consider the Entity Framework which does support different databases. You can find some supported providers here. The first 3 providers on that page support ORACLE.
If you want start a new project that is not SQL Server and you want to use a Microsoft ORM I recommend you to start using Entity Framework which supports MySQL and Oracle and ... and also you can use LINQ to Entity to communicate between your application and EF generated classes.
Hope this helps
Take a look at the Devart LINQ to Oracle tutorial.
But please note that you are not able to mix data from SQL Server and Oracle datacontexts.
Related
I need to know what is the best portable db, for this situation
I've an application base on sql server db, we use both LINQ TO SQL, and ADO.NET, in this application.
Now we need to make a portable version of it, but the fact we are using Linq To Sql, preventing us from using MS Access, as there is not out of the box solution for that (other than some 3rd parties, and we don't want to use them).
So I need to a db engine that is:
Portable
Have Linq support.
if it is not completely portable, is there is a one that can be easily attached & deattached, from client PC.
Did you check out SQL Compact Edition?
Downloadable for free and a list of reasons why to use it
It seems the latest and greatest version (4) does not support LINQ-to-SQL, but the previous version (3.5) does.
Check this code project article: LinqToSQL: Comprehensive Support for SQLite, Microsoft Access, SQServer2000/2005
Hope this helped.
I wonder the simplicity of working with Microsoft SQL database server with .NET Entity Framework. Is there a possible way to use it with Oracle & MySQL database servers?
You could use another ORM, like NHibernate which supports Microsoft SQL, Oracle, and MySQL, among many others.
If you want/need to stick with EF, there are already questions on SO about using it with MySQL and with Oracle.
Oracle Data Access Components for .NET (http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html) includes also Oracle Data Provider for .NET 4 11.2.0.2.40.
A nice tutorial how to use Model-First approach can be found at http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkOBE/EntityFrameworkOBE.htm.
Good luck,
LM
A list of Oracle providers for Entity Framework can be found here:
Comparison of Entity Framework compatible providers for Oracle?
And for MySQL these are available:
http://www.mysql.com/products/connector/
http://www.devart.com/dotconnect/entityframework.html
http://uda.openlinksw.com/dotnet/
Where can I see the documenation for entity framework, specifically where it has all the features of linq-to-sql? Is the database setup the same or just the syntax is the same to query over the objects, but mapping the db to models is different?
Any simple tutorials that you guys can suggest? nothing offical from MS, something from a real developer would be more suitable.
Microsoft doesn't continue to support LINQ to SQL ,they planed to EF replaces LINQ to SQL,because LINQ to SQL has many limitatins.
EF instead has more features, and is more powerful than LINQ to SQL, it can work with more providers, works with Oracle, My SQL and even SQL Lite... EF has all Linq features and more I guess...
I'm just starting to look into using LINQ for my database (and XML, and data object!) needs, but need to decide on which database to go with. I've been reading Pro LINQ, and it says that currently, LINQ in .NET 3.5 only supports SQL Server. I have done some googling, and have found references to using LINQ with MySQL and PostgreSQL (my other two DB options), but they are refer to DLinq, which I understand to be the predecessor of LINQ to DB.
I've read interesting and informative comparisons of the three databases here and here, but am still torn. I do not have any in-depth database experience, so it's important to be able to get the software installed and configured easily, or at least be easy to figure out how to compile a list of steps to configure it. I definitely want to have transactional support as well. But most importantly -- I want to use LINQ.
I'd like to hear what everyone here is using, whether it's SQL Server because LINQ supports it natively, or the other two with some additional component for LINQ support that I haven't yet found.
We use devart's dotConnect provider for Linq-to-Oracle and have been very pleased. They try and make the functionality match Linq-to-SQL as close as possible, which seems to be what you're looking for.
They have providers for:
Oracle
MySQL
PostgreSQL
SQLite
SQL Server
From a cost perspective, it's an excellent deal I'd say, just pay for developer seats, no server licensing.
I have heard that LINQ2SQL has been written to support multiple database vendor providers however for internal political reasons at MS, only SQL Server has been supported.
Is this a fair summary of the situation, and if so has a timetable been released as to when other databases will be supported?
I am aware of Matt Warren's BUILDING AN IQUERYABLE PROVIDER series on the wayward weblog, but I would prefer not to build something now that will be released (probably better than I will do it) later
Check the ADO.NET Entity Framework (and Linq to Entities), you can look here also a Sample Entity Framework Provider for Oracle, and here are more examples about creating Data Providers for EF.
Entity Framework has support for multiple database providers. There are no plans to expose or implement additional LINQ to SQL database providers.