Possible DataProvider's

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
ath
Posts: 5
Joined: Wed 28 Nov 2012 12:50

Possible DataProvider's

Post by ath » Wed 23 Jan 2013 10:30

I deployed LinqConnect to my solution, which communicates with SQL Server and SQLite databases. I've created two DataContext's with attributes:

Code: Select all

[Devart.Data.Linq.Mapping.Provider(typeof(Devart.Data.SqlServer.Linq.Provider.SqlDataProvider))]
public partial class CennikiDataContext : DataContext
and

Code: Select all

[Devart.Data.Linq.Mapping.Provider(typeof(Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider))]
public class CennikiDataContextLite : CennikiDataContext
When I use CennikiDataContext (SqlDataProvider) with System.Data.SqlClient.SqlConnection everything is OK.
When I try to use CennikiDataContextLite (SQLiteDataProvider) with System.Data.SQLite.SQLiteConnection(the open-source one http://system.data.sqlite.org/index.htm ... index.wiki) i have an exception during creation of DataContext:

Code: Select all

Invalid connection type. Expected Type: System.Data.SQLite.SQLiteConnection, Actual Type: Devart.Data.SQLite.SQLiteConnection
Is it possible to configure DataContext to use System.Data.SQLite.SQLiteConnection?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Re: Possible DataProvider's

Post by StanislavK » Wed 23 Jan 2013 15:43

Generally, SQLiteDataProvider works with dotConnect for SQLite connections (i.e., objects of the Devart.Data.SQLite.SQLiteConnection type) only.

To use some other connections (e.g., those from the System.Data.SQLite library) in your LinqConnect models, you can try implementing a descendant of DataProvider or SQLiteDataProvider. Some details on implementing such a class are discussed in the following topic:
http://forums.devart.com/viewtopic.php?f=31&t=25495

Also, could you please specify the purpose of using System.Data.SQLite.SQLiteConnection in your model?

ath
Posts: 5
Joined: Wed 28 Nov 2012 12:50

Re: Possible DataProvider's

Post by ath » Wed 23 Jan 2013 16:03

Now I understand.
If I want to have complementary solution for SQLite i should buy dotConnect for SQLite Professional(649,95$ for Site License) AND LinqConnect Professional(1499,95$ for Site License). Site License, because I need it for 5 developers meanwhile Team License is for 4.
Is that right?
General purpose - enable to work with SQL Server AND SQLite databases without some drastic changes to existing model in code.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Re: Possible DataProvider's

Post by StanislavK » Wed 23 Jan 2013 17:07

The Professional edition of LinqConnect includes the Express edition of dotConnect for SQLite. Thus, you don't have to buy dotConnect for SQLite to work with SQLite databases via LinqConnect. JIC: you can purchase any combination of Team and/or Single licenses, as long as they cover the total number of developers working with LinqConnect.

See the edition matrices of both products for the details:
http://www.devart.com/linqconnect/editions.html
http://www.devart.com/dotconnect/sqlite/editions.html

As for using the same model with different DBMSs, you may be interested in using the file mapping instead of the attribute one. Check, e.g., the following forum topic for the details:
http://forums.devart.com/viewtopic.php?f=31&t=24588

Post Reply