﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / sql server connection to database / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 22:58:18 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: sql server connection to database</title><link>http://www.sqlservercentral.com/Forums/Topic1419233-392-1.aspx</link><description>Thanks!</description><pubDate>Wed, 13 Feb 2013 08:01:16 GMT</pubDate><dc:creator>wendy elizabeth</dc:creator></item><item><title>RE: sql server connection to database</title><link>http://www.sqlservercentral.com/Forums/Topic1419233-392-1.aspx</link><description>[quote][b]wendy elizabeth (2/12/2013)[/b][hr]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. &amp;lt;connectionStrings&amp;gt;     &amp;lt;add name="RPCSS_DEVConnectionString"         connectionString="Data Source=dev;Initial Catalog=DEV2;User Id=myUsername;Password=myPassword;"         providerName="System.Data.SqlClient" /&amp;gt;   &amp;lt;/connectionStrings&amp;gt;[/quote]Correct.[quote]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?[/quote]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.</description><pubDate>Tue, 12 Feb 2013 17:53:02 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>sql server connection to database</title><link>http://www.sqlservercentral.com/Forums/Topic1419233-392-1.aspx</link><description>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. &amp;lt;connectionStrings&amp;gt;     &amp;lt;add name="RPCSS_DEVConnectionString"         connectionString="Data Source=dev;Initial Catalog=DEV2;User Id=myUsername;Password=myPassword;"         providerName="System.Data.SqlClient" /&amp;gt;   &amp;lt;/connectionStrings&amp;gt; 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?</description><pubDate>Tue, 12 Feb 2013 16:03:55 GMT</pubDate><dc:creator>wendy elizabeth</dc:creator></item></channel></rss>