IIS connection string

Hi,

I am having some issues changing a connection string to use a spesific domain account to authenticate on an sql server.
Senario: Server is 2012R2, SQL is 2014. Today I am using an sql user to authenticate which works fine using this code
 <connectionStrings>
    <add name="ConnectToApplication"
            connectionString="Server=servername;Database=databaseName;User ID=userName;Password=userPassword;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

I would like to let domain\username connect to the database but when I change the code to use Integrated Security=true it always tries to logon using the computer account.
what am I missing here?
SkyggnaAsked:
Who is Participating?
 
Manoj PatilSr. Software EngineerCommented:
Here is the link which will help you to check your keywords and meanings within ConnectionString

http://forums.asp.net/post/2824103.aspx

Screenshot of same URL
0
 
Duy PhamFreelance IT ConsultantCommented:
If you want to use Integrated Security with your Domain Account, your code must run under that Domain Account in order to connect to the database.
You could just run your code when logging in using your Domain Account
If you are developing a Windows Service, you can configured the Service to run under your Domain Account
If you are developing a Web Application/Web Site, you can configure the Impersonation as described here: https://msdn.microsoft.com/en-us/library/2xzyzb0f(v=vs.140).aspx

Hope this could give your some helps.
0
 
Lee SavidgeCommented:
As long as the application is running under a domain account that can connect to the database, you should be able to find a connection string from here:

http://www.connectionstrings.com/sql-server/

This is the most basic:

Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
I would like to let domain\username connect to the database but when I change the code to use Integrated Security=true it always tries to logon using the computer account.
When you use Integrated Security it means that will run in the current user context so with the current user credential.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.