Creating DataContext with opened Connection
Posted: Wed 28 Nov 2012 13:08
Currently, I am in evaluation period of testing LinqConnect.
My first step is to change "Linq To SQL" to "Devart.Data.Linq" on our project. Now it connects to SQL Server but in near future we would also like to work with SQLite. I have problem with creating DataContext instance. It is used like this:
Connection and Transaction objects are managed by other project. DataContext(IDBConnection) constructor gets opened Connection. During creation of DataContext I get an exception: Cannot change ConnectionString property. Connection is opened.
I don't want to change business logic currently implemented in this solution.
How to solve this problem?
My first step is to change "Linq To SQL" to "Devart.Data.Linq" on our project. Now it connects to SQL Server but in near future we would also like to work with SQLite. I have problem with creating DataContext instance. It is used like this:
Code: Select all
***DataContext ctxOrg = new ***DataContext(Connection);
ctxOrg.Transaction = Transaction;
I don't want to change business logic currently implemented in this solution.
How to solve this problem?