Cannot open database requested by the login. The login failed. Login failed for user
- by Cipher
Hi,
I have copied a DB from one my computers and using it here. On trying to open the page which requires the fetching content from DB, on con.open I am getting this exception:
Unable to open the physical file "E:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp.mdf". Operating system error 32: "32(The
process cannot access the file because
it is being used by another
process.)".
Unable to open the physical file "E:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp_log.LDF".
Operating system error 32: "32(The
process cannot access the file because
it is being used by another
process.)".
Cannot open database "cakephp" requested by the login. The login
failed.
Login failed for user 'Sarin-PC\Sarin'.
I have attached the database from Management Studio Express 2008 and I have also checcked the connection string. Here it is:
<connectionStrings>
<add name="cn" connectionString="server=.\sqlexpress;database=cakephp;integrated security=true;uid=sarin;pwd=******"/>
</connectionStrings>
In Visual Studio, when I test the connection, it says "Test connection succeeded". However, there is one strange thing going on. When I login to the Management Studio, there is no + sign with the newly attached database, as shown.
If the full WebConfig is reqiured to be seen, I have pasted it here: http://pastebin.com/sVAuN0Ug