473,387 Members | 1,464 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,387 software developers and data experts.

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 2034
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
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
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
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
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
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
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
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
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
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.