I have been using this connection string with no problem on a number of databases and MS operating systems. Sever 2003, 2008 R2 and 2012 R2 Eval.
I am now trying to deploy to a new Server 2012 R2 installation and I am getting some errors. I have the SQL 2008 R2 installation on the Server 2012 R2 machine.
My con string: connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myDB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
I think this must have something to do with the installation sequence of the components on the new server.
I have in the past been able to simply copy myDB.mdf to basically any web server and open or access the DB tables. This DB includes an ASP membership for the web site that it is tied to.
Here is the error:
Unable to open the physical file "C:\inetpub\techTran\App_Data\myDB.mdf". Operating system error 5: "5(Access is denied.)". An attempt to attach an auto-named database for file C:\inetpub\techTran\App_Data\myDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I realize this error has been posted all over the web. And I also understand what it is saying, or so I thought. I have checked permissions and they match all of the other servers where this database has been copied to. My SQL installations are basically all the same. The only difference here is that this is Server 2012 R2. Or I did not install the SQL 2008 R2 the same way I have done in the past 5 servers I have set up. (Which I am guessing is probably the case.)
I know there is only one database name on the server called myDB.mdf, so I don't believe the "same name" portion of error. I have added security to the db so that it can be opened and I even installed Visual Studio2012 on the server to be certain that the db could be opened. I can run the full app on the localhost (server 2012) but I can not access it over a web connection.
The home page loads and then the login throws the above error.
I think I am missing something pretty simple, so before I uninstall and reinstall, can anyone help?