473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Database Connection - Not Associated With Trusted Connection

I have a test server and a development machine. I have SQL Server installed
on both, the installations are pretty much identical. Both servers are in
the same domain. When I run my application locally, I can connect to the
local sql server as well as the sql server on the test server. The IIS
settings on both the test server and local machine are the same (anon
disabled, use integrated windows auth). Identity impersonate is on in
web.config.

When I run the application on the test server, I can connect to the test
server with the following connection string:
"server=testing;trusted_connection=yes;". However, when I point it to my
local machine ("server=mymachine;trusted_connection=yes;") I get the "Login
failed for user '(null)'. Reason: Not associated with a trusted SQL Server
connection." error.

Using the same two connection strings on my local machine work fine. The
only difference I know of is...the test machine is a child domain
(test.mydomain) while my local machine is under the primary domain
(mydomain). I can connect to it locally, but it can't seem to pass the
credentials from the test machine to my local machine...it sees it (can see
it using SQLBrowseConnect api function) and can connect to it using SQL
Query Analyzer using windows authentication through Terminal Services, but
it just doesn't work using ASP.Net :(

Can anyone help?

Thanks,
Mythran

Nov 19 '05 #1
5 1859
I'm trying to keep track of the machine and network hops involved, but
it sounds like you are facing the dreaded double hop issue trying to
impersonate the user.

If you must carry the client's identity all the way to the database,
you'll need to use delegation. I have pointers here:
http://odetocode.com/blogs/scott/arc...2/24/1053.aspx

If you don't need to client's identity there are easier options
available...

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 4 Oct 2005 16:37:03 -0700, "Mythran"
<ki********@hotmail.comREMOVETRAIL> wrote:
I have a test server and a development machine. I have SQL Server installed
on both, the installations are pretty much identical. Both servers are in
the same domain. When I run my application locally, I can connect to the
local sql server as well as the sql server on the test server. The IIS
settings on both the test server and local machine are the same (anon
disabled, use integrated windows auth). Identity impersonate is on in
web.config.

When I run the application on the test server, I can connect to the test
server with the following connection string:
"server=testing;trusted_connection=yes;". However, when I point it to my
local machine ("server=mymachine;trusted_connection=yes;") I get the "Login
failed for user '(null)'. Reason: Not associated with a trusted SQL Server
connection." error.

Using the same two connection strings on my local machine work fine. The
only difference I know of is...the test machine is a child domain
(test.mydomain) while my local machine is under the primary domain
(mydomain). I can connect to it locally, but it can't seem to pass the
credentials from the test machine to my local machine...it sees it (can see
it using SQLBrowseConnect api function) and can connect to it using SQL
Query Analyzer using windows authentication through Terminal Services, but
it just doesn't work using ASP.Net :(

Can anyone help?

Thanks,
Mythran


Nov 19 '05 #2
Well i had the same issue once and what i did was to imperosnate the user in
webconfig with adding the username
and the password.
I guess it wasn't the best idea but it solved the problem
Patrick

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:mk********************************@4ax.com...
I'm trying to keep track of the machine and network hops involved, but
it sounds like you are facing the dreaded double hop issue trying to
impersonate the user.

If you must carry the client's identity all the way to the database,
you'll need to use delegation. I have pointers here:
http://odetocode.com/blogs/scott/arc...2/24/1053.aspx

If you don't need to client's identity there are easier options
available...

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 4 Oct 2005 16:37:03 -0700, "Mythran"
<ki********@hotmail.comREMOVETRAIL> wrote:
I have a test server and a development machine. I have SQL Server installedon both, the installations are pretty much identical. Both servers are inthe same domain. When I run my application locally, I can connect to the
local sql server as well as the sql server on the test server. The IIS
settings on both the test server and local machine are the same (anon
disabled, use integrated windows auth). Identity impersonate is on in
web.config.

When I run the application on the test server, I can connect to the test
server with the following connection string:
"server=testing;trusted_connection=yes;". However, when I point it to my
local machine ("server=mymachine;trusted_connection=yes;") I get the "Loginfailed for user '(null)'. Reason: Not associated with a trusted SQL Serverconnection." error.

Using the same two connection strings on my local machine work fine. The
only difference I know of is...the test machine is a child domain
(test.mydomain) while my local machine is under the primary domain
(mydomain). I can connect to it locally, but it can't seem to pass the
credentials from the test machine to my local machine...it sees it (can seeit using SQLBrowseConnect api function) and can connect to it using SQL
Query Analyzer using windows authentication through Terminal Services, butit just doesn't work using ASP.Net :(

Can anyone help?

Thanks,
Mythran

Nov 19 '05 #3
If your requirements allow you to use a fixed identity that solution
works well and is very simple, yes.
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 5 Oct 2005 14:47:25 +1000, "Patirck Ige"
<na********@hotmail.com> wrote:
Well i had the same issue once and what i did was to imperosnate the user in
webconfig with adding the username
and the password.
I guess it wasn't the best idea but it solved the problem
Patrick


Nov 19 '05 #4
if your site is impersonating the users creditials, asp.net only supports
trusted connections to a local sqlserver (same box), unless you are using
kerberos and enable credital forwarding.

if you can use a fixed account, then specify the userName and password in
the web.config.

-- bruce (sqlwork.com)
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:OH**************@tk2msftngp13.phx.gbl...
I have a test server and a development machine. I have SQL Server
installed on both, the installations are pretty much identical. Both
servers are in the same domain. When I run my application locally, I can
connect to the local sql server as well as the sql server on the test
server. The IIS settings on both the test server and local machine are the
same (anon disabled, use integrated windows auth). Identity impersonate is
on in web.config.

When I run the application on the test server, I can connect to the test
server with the following connection string:
"server=testing;trusted_connection=yes;". However, when I point it to my
local machine ("server=mymachine;trusted_connection=yes;") I get the
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection." error.

Using the same two connection strings on my local machine work fine. The
only difference I know of is...the test machine is a child domain
(test.mydomain) while my local machine is under the primary domain
(mydomain). I can connect to it locally, but it can't seem to pass the
credentials from the test machine to my local machine...it sees it (can
see it using SQLBrowseConnect api function) and can connect to it using
SQL Query Analyzer using windows authentication through Terminal Services,
but it just doesn't work using ASP.Net :(

Can anyone help?

Thanks,
Mythran

Nov 19 '05 #5

"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
if your site is impersonating the users creditials, asp.net only supports
trusted connections to a local sqlserver (same box), unless you are using
kerberos and enable credital forwarding.

if you can use a fixed account, then specify the userName and password in
the web.config.

-- bruce (sqlwork.com)


Yes, I have used fixed accounts in connection strings before. But I was
just trying to get it to work with windows authentication...but I see that I
have to enable Kerberos and that will take some thought and planning...

Thanks ;)

Mythran

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TBone | last post by:
Anyone, I have a user "john" whose machine is part of the "job" domain. He is trying to establish an odbc connection to an MS SQL 2000 server on the "school" domain. He uses Windows...
2
by: DMS | last post by:
am new to ASP.NET and IIS web applications, but not to SQL databases. I can successfully build Windows apps using Visual Studio that use ADO. However, for Web Forms, I created data connection and...
1
by: Mark | last post by:
We are using impersonation so that a user on our domain will login into our SQL Server using their own domain login and/or associated domain groups. To do this, we've added: <authentication...
2
by: Blake Versiga | last post by:
I am pulling my hair out..... I am trying to put a bound data grid on a webform... I have 4 data connections in my server explorer, all of which connect successfully. But when I run the web...
7
by: Ray Valenti | last post by:
I am able to preview this data in the development environment, but when I run the application the error below shows up. How do I set up a Trusted Connection? -Ray Server Error in...
0
by: Dennis | last post by:
I am working on an ASP.NET 2.0 site. It runs fine on my local PC. When I deploy it to the server I get this error: Login failed for user ''. The user is not associated with a trusted SQL Server...
2
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
How to configure the IIS, ASPNET userID, Windows or SQL Authentiation, std or integrated security for SQLserver database? The VS.net 2002 web server and SQL Server client are at the same PC, ...
0
by: StephanieCat | last post by:
Hi I'm newbie in C# database programming and SQL Server as well. I am using windows XP on my laptop. MSSQLServer Client is installed. The connection is set to use Windows authentication. My...
3
by: Newbie19 | last post by:
I'm having an issue with viewing my ASP/SQL application in Internet Explorer. I get the error from my Server (located on my PC using IIS 5.0) stating: Login failed for user '(null)'. Reason: Not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.