February 12, 2013 at 4:03 pm
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?
The following is a connection string that points to a sql server 2008 r2 database.
<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?
February 12, 2013 at 5:53 pm
wendy elizabeth (2/12/2013)
if the following is in the connection string in an app.config file, the following will use the sql server login and not thewindows user login correct?
The following is a connection string that points to a sql server 2008 r2 database.
<connectionStrings>
<add name="RPCSS_DEVConnectionString"
connectionString="Data Source=dev;Initial Catalog=DEV2;User Id=myUsername;Password=myPassword;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Correct.
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?
Not via the connection string. What you can do is create a new thread under a different security context (lookup WindowsIdentity) and to create the new context you will supply a Windows Account's user and password. Then, on that thread running as the different account you can use a connection string that is setup to use Windows Authentication and it will leverage that user's account to make the connection, not the account that spawned the new thread.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
February 13, 2013 at 8:01 am
Thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply