I am having a strange problem. I have an application that to connects to SQL Database in SQL Server 2005.
When I run the application with Visual Studio everything works fine but when I deploy the application on my web server and then to access the site .
I get an error :Login failed for user ''. The user is not associated with a trusted SQL Server connection.
For some reason the application is not passing the user name . I have checked the IIS and authentication is set to Integrated Windows Authentication .
My connection string is correct as well
<add name="xxxxx" connectionString="Data Source=xxxxxx;Initial Catalog=xxxx;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
I will appreciate any kind of assistance in this matter. Thanks
check under which login your asp web page works ASPNET or Network service and create login on your SQL server for this account.
You also have to give access to your databases for this login.
If you run web page on IIS server user under which IIS server is running (or your web page specific user) requests access to SQL server.
|||
I check my sql logs and when I tried to make a connection using : UID and PWD in my connection string. The log says that
Login failed for user "<username"> [CLIENT:xxx.xxx.xxx.xxx]
below that I saw the the same user successfully logged using Management Studio saying
Login succeeded for user "<username>" [CLIENT:local machine]
I don't understand the difference. It is the same user connecting from the same local machine where sql is loaded.
Thanks
No comments:
Post a Comment