Page 1 of 1

Possible DataProvider's

Posted: Wed 23 Jan 2013 10:30
by ath
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?

Re: Possible DataProvider's

Posted: Wed 23 Jan 2013 15:43
by StanislavK
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?

Re: Possible DataProvider's

Posted: Wed 23 Jan 2013 16:03
by ath
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.

Re: Possible DataProvider's

Posted: Wed 23 Jan 2013 17:07
by StanislavK
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