Open GusBeare opened 8 years ago
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. Is this a Simple.Data issue or a SQL server Express one?
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?