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 the
windows user login correct?
The following is a connection string that points to a sql server 2008 r2 database.
connectionString="Data Source=dev;Initial Catalog=DEV2;User Id=myUsername;Password=myPassword;"
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