473,785 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_connec tion=yes;". However, when I point it to my
local machine ("server=mymach ine;trusted_con nection=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 SQLBrowseConnec t 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 1886
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********@hot mail.comREMOVET RAIL> 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=testin g;trusted_conne ction=yes;". However, when I point it to my
local machine ("server=mymach ine;trusted_con nection=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 SQLBrowseConnec t 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.o detocode.com> wrote in message
news:mk******** *************** *********@4ax.c om...
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********@hot mail.comREMOVET RAIL> 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=testin g;trusted_conne ction=yes;". However, when I point it to my
local machine ("server=mymach ine;trusted_con nection=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 SQLBrowseConnec t 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********@hot mail.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********@hot mail.comREMOVET RAIL> wrote in message
news:OH******** ******@tk2msftn gp13.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_connec tion=yes;". However, when I point it to my
local machine ("server=mymach ine;trusted_con nection=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 SQLBrowseConnec t 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.c om> wrote in message
news:%2******** ********@TK2MSF TNGP09.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
14635
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 authentication to establish the odbc connection however it gives the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." I am guessing that the odbc connection is trying to pass the credentials of job\john...
2
16494
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 sqladapter to my SQL Server - Northwind - which I dragged from Server Explorer. I generate a dataset, and Preview Data in the da, works fine. I then enter vb code on Page_Load event: SqlDataAdapter1.Fill(ds) DataGrid1.DataSource =...
1
2721
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 mode="Windows" /> <identity impersonate="true"/> to our web.config file. In IIS, annonymous access is unchecked, digest authentication is unchecked, basic authentication is unchecked, and Integrated Windows Authentication is checked.
2
31133
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 page I get the error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. I use a connection string in my application in several other pages with no
7
2166
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 '/WebApplication2' Application. ---------------------------------------------------------------------------- ----
0
1043
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 connection. SqlException (0x80131904): Login failed for user ''. The user is not associated with a trusted SQL Server connection.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734867
2
3811
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, while the SQL Server database is at another PC. The dataset and DataGrid were created successfully. However, when trying to run a Web Form with a table, a server error msg: Login failed for user '(null)'. Reason: Not associated with a trusted...
0
1543
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 windows user name is "stephanie cat" without any password. I use C# in VS.NET 2003 to connect to SQL Server database (a simple console application). The northwind database has been downloaded and attached to current SQL Server instance. I can view the...
3
2518
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 associated with a trusted SQL Server connection. I am connected to the database because I can view it in VS 05 and run test queries on it in VS. However, when I view the application on Internet explorer I get the error. My connection string is:...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.