-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error using named connection and SQL Express #390
Comments
I use SQL Server 2012 Enterprise, Standard and Express no differences in connecting. Make sure a connection section exists in the config with that exact name on all the computers using your code. |
Thanks Wayne. My colleague has the same code base and web.config as myself. The connection strings are in his web.config. I am wondering if there is an issue with underscores in the connection string name? I will check out this theory and report back. |
Yes, I was correct. Having an underscore in the connection name causes the error in SQL Express 2012. Removing the underscore fixed the problem. |
Interesting.I have never tried using a leading underscore in the connection name. I don't see how it could be Simple.data as ut just uses the SqlConnection object. |
I am using SImple.Data locally and have this code:
var db = Database.OpenNamedConnection("q2_admin");
//var db = Database.Open();
It works fine in my dev environment where I am using a developer version of SQL server 2012.
However when my colleague runs the code on his box with SQL Express 2012 he gets this error:
[Error] Specified argument was out of the range of valid values.
Parameter name: connectionName
If I switch to using the default connection it works fine.
Is SQL Express supported? Or is this a bug?
The text was updated successfully, but these errors were encountered: