Closed GoogleCodeExporter closed 9 years ago
Can you elaborate? Is Customers an entity type or your DataContext subclass?
If it's the former, entity types aren't supposed to have constructors which
take
string or IDbConnection parameters.
If it's the latter, what error are you getting? The unit tests use the
constructor
which accepts a string parameter, not the IDbConnection overload.
Original comment by jonmpr...@gmail.com
on 18 Apr 2010 at 1:54
It's the latter. I am using the class that inherits from DataContext directly.
Please not that I am using MySQL.
Code #1 (NOT WORKING)
string connectionString
= "Server=localhost;User=MyUser;Password=MyPass;Database=MyDB;Use
Compression=True;Connection Protocol=Sockets";
using (Customer custDB = new Customer(connectionString))
{
....
}
Code #2 (WORKS CORRECTLY)
string connectionString
= "Server=localhost;User=MyUser;Password=MyPass;Database=MyDB;Use
Compression=True;Connection Protocol=Sockets";
using (Customer custDB=new Customer( new MySqlConnection(connectionString)))
{
...
}
The connectionStrings in #1 and #2 are the same. All the code is the same,
except
the using(...) command.
The error I get in the #1 case is
"Unable to load the `DbLinq.SqlServer' DbLinq vendor within assembly
'SqlServer.dll'.
Parameter name: connectionString"
Please note again that I am using MySQL.
From the metadata of DataContext class I see a [DBLinqToDo] attribute on top
the
DataContext constructor.
[DbLinqToDo]
public DataContext(string connectionString);
Original comment by tzograp...@gmail.com
on 19 Apr 2010 at 1:18
See: http://code.google.com/p/dblinq2007/wiki/Installation#To_use_DbLinq
Specifically, you need to provide the DbLinqConnectionType and DbLinqProvider
key/value pairs in your connection string. If you don't provide these, DbLinq
defaults to Microsoft SQL Server types.
Original comment by jonmpr...@gmail.com
on 19 Apr 2010 at 2:32
Original issue reported on code.google.com by
tzograp...@gmail.com
on 17 Apr 2010 at 10:57