Monday, February 20, 2012

Problem connecting to sql server express

Hi Guys

i have a problem with my asp.net 2.0 application, I'm trying to connect to sql server database but it gives the following error:

System.Data.SqlClient.SqlException: Cannot open database "MyDatabase" requested by the login. The login failed.
Login failed for user 'Myserver\ASPNET'.

Before i had my application on File System and it was connecting fine, now I moved it to IIS and it doesn't work anymore.

Connection at Web.Config file :

configuration>

<appSettings>

<addkey="ConnectionString"value="server=(local)\SQLEXPRESS; Trusted_Connection=true; database=MyDatabase"></add>

</appSettings>

<connectionStrings/>

How do i create login for that user?

Thanks

Hi, the ASPNET is the IIS account. You can take a look at this post:

http://forums.asp.net/thread/1356875.aspx

|||

Thanks Iori_Jay

That post really helped me, it's working now.

No comments:

Post a Comment