What database vendors does LINQ to SQL support?

2019-05-07 14:21发布

问题:

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?

回答1:

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


回答2:

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.



回答3:

Not officially, but there are a variety of projects implementing LINQ to SQL for other databases, for example: http://www.codeplex.com/LinqToOracle



回答4:

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.



回答5:

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



回答6:

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.



标签: linq-to-sql