Wednesday, March 7, 2012

Help moving from SQL Server Express to SQL Server Developer

I built a web application using my VS2005 installation, which includes SQL Server Express.

All works nicely. However, when I tried to move this application to a system with SQL Server Developer, I cannot get it to work at all - data access receives several errors, with the most common being this one:

Cannot open database "xyz.mdf" requested by the login. The login failed. Login failed for user 'MACHINE\ASPNET'.

Here is my connection string (with specific names changed, obviously):

Data source=MACHINE;Initial Catalog=xyz.mdf;Integrated Security=SSPI;User=Me;Password=MyPassword

I have given users MACHINE\ASPNET and MACHINE\Me all possible permissions (that I know) within SQL Server.

I have spent days on this, with no solution - help would be most appreciated.

use the following syntax for the connection string 
<connectionStrings> <add name="DatabaseConnection" connectionString="Data Source=(local);Initial Catalog=Northwind;IntegratedSecurity=SSPI;" /></connectionStrings>
|||

Thank you!

I must admit, I do not exactly understand the difference between my example and yours - but yours worked!

Much appreciated.

|||

Hi,

This is because unlike SQL Express, connecting to the SQL Server Developer edition requires you to use the instance name instead of the database file name.

Also, you need to remove the username and password to make sure that you're connecting with the windows integrated authentication.

No comments:

Post a Comment