1
Reply

C# connect to database

dc

dc

Feb 12 2013 5:40 PM
1.1k
In a C# 2008 windows application I found out the following when the application is executed for a task scheduler:
The windows username and password are exactly the same as the sql server username and password.
Thus if the following is in the connection string in an app.config file, the following will use the sql server login and not the
windows user login correct?
<connectionStrings>
    <add name="RPCSS_DEVConnectionString"
        connectionString="Data Source=dev;Initial Catalog=DEV2;User Id=myUsername;Password=myPassword;"
        providerName="System.Data.SqlClient" />
  </connectionStrings>

Also can you tell me if there is any way for the windows user name and password to be used when connecting to the
sql server 2008 r2 database? If so, can you tell me what the connection sting would be so I know to avoid that connection string?

Answers (1)