473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Connection Exception

When I try to run my WinForms app. I get the exception below while trying to
connect to a remote database with the following connect string:

private static string sCon = "NETWORK library=dbmssocn;data
source=192.168.0.6,1433;initial catalog=Fred;user ID=IUSR_AJC2;Password=";

Unhandled Exception: System.Data.SqlClient.SqlException: Login failed for
user 'IUSR_AJC2'. Reason: Not associated with a trusted SQL Server
connection.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at Callview1.frmMain..ctor() in d:\work\logger\callview1\main.cs:line 189
at Callview1.frmMain.Main() in d:\work\logger\callview1\main.cs:line 1197
Can anybody explain what the problem is here? How do I associate this login
with a trusted SQL connection?
Thanks!
Jul 21 '05 #1
4 2036
You need to 1) Verify that IUSR_AJC2 does in fact have permission on the
SQL Server. Without this, the DB won't let you in. Next, Replace the ID
and Password fields with Integrated Security = SSPI. When you use a trust,
SQL Server trusts that the DC has already authenticated you and that you are
who you cliam to be. As such, if knows your username and password so you
don't need to pass them in.

"Data Source=192.168.0.6, 1433;Initial Catalog=Fred;Integrated
Security=SSPI;"

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
When I try to run my WinForms app. I get the exception below while trying to connect to a remote database with the following connect string:

private static string sCon = "NETWORK library=dbmssocn;data
source=192.168.0.6,1433;initial catalog=Fred;user ID=IUSR_AJC2;Password=";

Unhandled Exception: System.Data.SqlClient.SqlException: Login failed for
user 'IUSR_AJC2'. Reason: Not associated with a trusted SQL Server
connection.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at Callview1.frmMain..ctor() in d:\work\logger\callview1\main.cs:line 189 at Callview1.frmMain.Main() in d:\work\logger\callview1\main.cs:line 1197 Can anybody explain what the problem is here? How do I associate this login with a trusted SQL connection?
Thanks!

Jul 21 '05 #2
Thanks, William. It appears that with the following connection string:

data source=192.168.0.6,1433;initial catalog=Fred;integrated security=SSPI

I can connect from within the VS.NET environment but not from a browser with
http://localhost/CallviewDebug/Callview1.exe

The difference would appear to be that the former is in the "My Computer"
zone whereas the latter is in the "Local Intranet" zone. So what I need to
know is how to get my app. to run from "Local Intranet" or Internet?

Many thanks.
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OK****************@TK2MSFTNGP10.phx.gbl...
You need to 1) Verify that IUSR_AJC2 does in fact have permission on the
SQL Server. Without this, the DB won't let you in. Next, Replace the ID
and Password fields with Integrated Security = SSPI. When you use a trust, SQL Server trusts that the DC has already authenticated you and that you are who you cliam to be. As such, if knows your username and password so you
don't need to pass them in.

"Data Source=192.168.0.6, 1433;Initial Catalog=Fred;Integrated
Security=SSPI;"

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
When I try to run my WinForms app. I get the exception below while trying
to
connect to a remote database with the following connect string:

private static string sCon = "NETWORK library=dbmssocn;data
source=192.168.0.6,1433;initial catalog=Fred;user

ID=IUSR_AJC2;Password=";
Unhandled Exception: System.Data.SqlClient.SqlException: Login failed for user 'IUSR_AJC2'. Reason: Not associated with a trusted SQL Server
connection.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at Callview1.frmMain..ctor() in d:\work\logger\callview1\main.cs:line

189
at Callview1.frmMain.Main() in d:\work\logger\callview1\main.cs:line

1197
Can anybody explain what the problem is here? How do I associate this

login
with a trusted SQL connection?
Thanks!


Jul 21 '05 #3
You are going to have to adjust you local security settings (which isn't too
big of a deal on most networks b/c it's your internal network - connecting
to the Internet on the other hand, takes a bit more consideration and
planning). you can just use the Security Configuration wizards and bump up
the local network settings.

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
Thanks, William. It appears that with the following connection string:

data source=192.168.0.6,1433;initial catalog=Fred;integrated security=SSPI

I can connect from within the VS.NET environment but not from a browser with http://localhost/CallviewDebug/Callview1.exe

The difference would appear to be that the former is in the "My Computer"
zone whereas the latter is in the "Local Intranet" zone. So what I need to
know is how to get my app. to run from "Local Intranet" or Internet?

Many thanks.
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OK****************@TK2MSFTNGP10.phx.gbl...
You need to 1) Verify that IUSR_AJC2 does in fact have permission on the
SQL Server. Without this, the DB won't let you in. Next, Replace the ID and Password fields with Integrated Security = SSPI. When you use a

trust,
SQL Server trusts that the DC has already authenticated you and that you

are
who you cliam to be. As such, if knows your username and password so you don't need to pass them in.

"Data Source=192.168.0.6, 1433;Initial Catalog=Fred;Integrated
Security=SSPI;"

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
When I try to run my WinForms app. I get the exception below while trying
to
connect to a remote database with the following connect string:

private static string sCon = "NETWORK library=dbmssocn;data
source=192.168.0.6,1433;initial catalog=Fred;user

ID=IUSR_AJC2;Password=";
Unhandled Exception: System.Data.SqlClient.SqlException: Login failed for user 'IUSR_AJC2'. Reason: Not associated with a trusted SQL Server
connection.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at Callview1.frmMain..ctor() in

d:\work\logger\callview1\main.cs:line 189
at Callview1.frmMain.Main() in
d:\work\logger\callview1\main.cs:line 1197
Can anybody explain what the problem is here? How do I associate this

login
with a trusted SQL connection?
Thanks!



Jul 21 '05 #4
Thanks, William. I used the .NET wizard to raise the "Local Intranet"
settings to full trust and ran
http://localhost/CallviewDebug/Callview1.exe

It froze for about two minutes and then the browser comes back with a CGI
timeout.

Any idea what is causing this?

Many thanks!

"William Ryan" <do********@nospam.comcast.net> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
You are going to have to adjust you local security settings (which isn't too big of a deal on most networks b/c it's your internal network - connecting
to the Internet on the other hand, takes a bit more consideration and
planning). you can just use the Security Configuration wizards and bump up the local network settings.

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
Thanks, William. It appears that with the following connection string:

data source=192.168.0.6,1433;initial catalog=Fred;integrated security=SSPI

I can connect from within the VS.NET environment but not from a browser

with
http://localhost/CallviewDebug/Callview1.exe

The difference would appear to be that the former is in the "My Computer" zone whereas the latter is in the "Local Intranet" zone. So what I need to know is how to get my app. to run from "Local Intranet" or Internet?

Many thanks.
"William Ryan" <do********@nospam.comcast.net> wrote in message
news:OK****************@TK2MSFTNGP10.phx.gbl...
You need to 1) Verify that IUSR_AJC2 does in fact have permission on the SQL Server. Without this, the DB won't let you in. Next, Replace the ID and Password fields with Integrated Security = SSPI. When you use a

trust,
SQL Server trusts that the DC has already authenticated you and that you are
who you cliam to be. As such, if knows your username and password so you don't need to pass them in.

"Data Source=192.168.0.6, 1433;Initial Catalog=Fred;Integrated
Security=SSPI;"

HTH,

Bill
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
> When I try to run my WinForms app. I get the exception below while

trying
to
> connect to a remote database with the following connect string:
>
> private static string sCon = "NETWORK library=dbmssocn;data
> source=192.168.0.6,1433;initial catalog=Fred;user

ID=IUSR_AJC2;Password=";
>
> Unhandled Exception: System.Data.SqlClient.SqlException: Login
failed
for
> user 'IUSR_AJC2'. Reason: Not associated with a trusted SQL Server
> connection.
> at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
> isInTransaction)
> at
>

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec > tionString options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at Callview1.frmMain..ctor() in

d:\work\logger\callview1\main.cs:line 189
> at Callview1.frmMain.Main() in d:\work\logger\callview1\main.cs:line 1197
> Can anybody explain what the problem is here? How do I associate this login
> with a trusted SQL connection?
> Thanks!
>
>



Jul 21 '05 #5

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

Similar topics

0
4724
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
0
5350
by: Bob | last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem...
6
2328
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
4
4130
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
26
16451
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
7
2194
by: Mrinal Kamboj | last post by:
Hi , I am using OracleConnection object from Oracle ODP.net provider and following is the behaviour which i am finding bit strange : To start with my argument is based on followings facts : ...
3
10267
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
20
3235
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
3
5473
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
0
7054
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,...
0
7102
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...
1
6756
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...
0
7003
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...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
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...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
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...

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.