开发者

How do I get my ASP.Net MVC2 application to authenticate with the SQL Server using Sql Authentication?

开发者 https://www.devze.com 2023-03-19 18:58 出处:网络
I deployed an ASP.net MVC 2 application on my Windows Server 2008 IIS7 server and it bombs out reporting:

I deployed an ASP.net MVC 2 application on my Windows Server 2008 IIS7 server and it bombs out reporting:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I have SQL Server authentication enabled on the server and I have created a login for the database that I am trying to reach. I don't understand why the 'NT AUTHORITY\ANONYMOUS LOGON' credential is being used. This must be the context in which the application is running (application pool). I assumed that the application would just use the credentials specified in the connectionstring. How can configure IIS7 and/or ASP.net to just login using the user and pass provided in the connection string specified within the web.config?

Thanks a ton.

I'm pretty sure the problem is at the SQL Server or with my IIS configuration. The application works from my development开发者_C百科 machine.

Connnection String :

connectionString="Data Source=servername;Initial Catalog=TestPortal;User Id=username;Password=password;"


By default Entity Framework connection string has:

Integrated Security=True;

This should be removed from both the asp.net membership provider connectionstring as well as from the entity framework's generated connectionstring.


Your connection string should look like this:

Data Source=SomeServerName;Initial Catalog=SomeDB;User Id=user;Password=pwd;

And SQL authentication must be enabled on the SQL Server.

0

精彩评论

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