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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.