T
Thomas Kadlec
Before I describe the problem let me try to eliminate any obvious issues...
- There are two sql servers: "Production" and "Staging".
- Both SQL servers are set to "SQL Server and Windows" authentication mode.
(I have verified this multiple times).
- There is a development machine: "Development". (although any machine we
try to connect from using the following has the same behavior)
- All of these machines are on the same local network.
The problem: We are unable to establish a connection from an ASP.NET app
running on the Development machine under the Development\IUSER_Development
account to the "Staging" server using SQL Server authentication. Here is
the connection string... (passwords have been changed to protect the
innocent.)
"Server=Staging; Database=V2Staging; User=sa; Password=development"
The exception: System.Data.SqlClient.SqlException: SQL Server does not
exist or access denied. at
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
SqlSecurityTest.WebForm1.Connect(String connectionString) in
c:\inetpub\wwwroot\sqlsecuritytest\default.aspx.cs:line 57 at
SqlSecurityTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\sqlsecuritytest\default.aspx.cs:line 36
Oddity 1: We CAN establish a connection from an ASP.NET app running on the
Development machine under the Development\IUSER_Development account to the
"Production" server SQL Server authentication.. Here is that connection
string...
"Server=Production; Database=V2Production; User=sa; Password=production"
Oddity 2: We CAN establish connections from an ASP.NET app running on the
Development machine under the NT AUTHORITY\NETWORK SERVICE account to the
BOTH servers using SQL Server authentication..
Question 1: Why can we connect to one sql server running under the
Development\IUSER_Development account but not the other sql server?
Question 2: What is it about the NT AUTHORITY\NETWORK SERVICE account that
allows connections to both sql servers?
Question 3: When using SQL Server authentication what exactly is happening?
i.e. why should the windows account the application is running under effect
connectivity to a SQL Server at all?
Thank you for your help,
- Thomas Kadlec
(e-mail address removed)
- There are two sql servers: "Production" and "Staging".
- Both SQL servers are set to "SQL Server and Windows" authentication mode.
(I have verified this multiple times).
- There is a development machine: "Development". (although any machine we
try to connect from using the following has the same behavior)
- All of these machines are on the same local network.
The problem: We are unable to establish a connection from an ASP.NET app
running on the Development machine under the Development\IUSER_Development
account to the "Staging" server using SQL Server authentication. Here is
the connection string... (passwords have been changed to protect the
innocent.)
"Server=Staging; Database=V2Staging; User=sa; Password=development"
The exception: System.Data.SqlClient.SqlException: SQL Server does not
exist or access denied. at
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
SqlSecurityTest.WebForm1.Connect(String connectionString) in
c:\inetpub\wwwroot\sqlsecuritytest\default.aspx.cs:line 57 at
SqlSecurityTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\sqlsecuritytest\default.aspx.cs:line 36
Oddity 1: We CAN establish a connection from an ASP.NET app running on the
Development machine under the Development\IUSER_Development account to the
"Production" server SQL Server authentication.. Here is that connection
string...
"Server=Production; Database=V2Production; User=sa; Password=production"
Oddity 2: We CAN establish connections from an ASP.NET app running on the
Development machine under the NT AUTHORITY\NETWORK SERVICE account to the
BOTH servers using SQL Server authentication..
Question 1: Why can we connect to one sql server running under the
Development\IUSER_Development account but not the other sql server?
Question 2: What is it about the NT AUTHORITY\NETWORK SERVICE account that
allows connections to both sql servers?
Question 3: When using SQL Server authentication what exactly is happening?
i.e. why should the windows account the application is running under effect
connectivity to a SQL Server at all?
Thank you for your help,
- Thomas Kadlec
(e-mail address removed)