Friday, February 24, 2012

Connection string problem

Hi people,
I have my web application running on my machine and it works on the current machine where I have created the project when I type localhost on the web browser. I tried running the application from another machine within the same network by typing the IP address of the machine where my asp.net project is located, the application works, but SQL Server wouldn't allow connection to be made when I start calling data from the database. I have set Impersonate="true" in the web.config file. Am I doing something wrong here?
Here's the configuration on the web.config file

<identityimpersonate="true"/>

<appSettings>

<addkey="Connection"

value="Server=SQLOLEDB.1;Data Source=SQLServer;Initial Catalog=myDatabase;Trusted_Connection=True;"/>

</appSettings>


Please help....
Kero

When you do that you impersonate IUSR_COMPUTERNAME; so, in that scenario that account must have rights to the database.
I think you may have to use Sql Server authentication and pass a userid/pwd pair in your conn string.
|||Thanks ChicoUser,
I have sort out my impersonate problem by following one of the tutorials from microsoft website. I have set up a Customer user instead using Aspnet account on the machine and given appropriate permissions to access the files. In the Web.config file I have added impersonate =true and provided username and password which allows the created account to get access to my SQL SERVER. It's working now.
kero :)

No comments:

Post a Comment