开发者

Can not connect to SQL express database. "login Failed" error

开发者 https://www.devze.com 2023-03-26 14:29 出处:网络
The problem: I getthe following error when I try to access my web app. Im running sql express 2008 r2 Cannot open user default database. Login failed.

The problem: I get the following error when I try to access my web app. Im running sql express 2008 r2

Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Background: I create my ASPNETDB in Visual studio via the app data folder. I then uploaded the files of my application to my IIS server. I had no problems, my application was working as expected.

I had the need to attach my DB to SQL server management studio. I attached the ASPNETDB, however I now get the above error message whenever I try to access my web app. I don’t know how to rectify this error. Im not very experienced in this.

What Ive tried:

I added 'NT AUTHORITY\NETWORK SERVICE' as a login under Databases> Security > Logins.

I then added 'NT AUTHORITY\NETWORK SERVICE' as a user to the particular开发者_Go百科 DB I wanted to connect to Databases >TheDatabaseIAttached > Sercurity > Users

I still get the same error message.

my connection string

<connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

Any help would be greatly appreciated, thanks kindly

0

精彩评论

暂无评论...
验证码 换一张
取 消