We have legacy connection strings in use by different sql clients from years past. The connection string has legacy syntax: "Provider=SQLOLEDB"
.
Provider=SQLOLEDB;Data Source=<servername>;Initial Catalog=<dbname>;Integrated Security=SSPI
EF6 uses different SQL client and providers obviously.
So my question is, does there exist a way to configure EF6 to use a provider or connection provider factory that will know how to deal with the provider keyword in the connection string? Currently I'm getting the error message
Keyword not supported: 'provider'.
I was hoping there might be a way to avoid changing the connection string that doesn't involve a run-time tweak to remove the keyword from the original connection string.
The problem is that Entity Framework is a .NET thing. And in ADO.net you are not allowed to use the
SQLOLEDB
provider.Even though you are actually using the OleDbConnection class, and normally OLEDB lets you specify the OLEDB Provider, you're just not allowed to here.
The ADO.net OleDbConnection class detects if you try to use the
SQLOLEDB
provider, and simply throws an error.I know that's not (yet) what you're seeing here. What you're seeing here is explained here: