Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2003, 11:20 PM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trusted SQL Server Connection

I installed Visual Studio .NET 2003, and reinstalled MSDE along with updates including SQL service pack 3a.

I am getting the following error when I try to run my project:
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'SA_48484848IUSR_JAMALONE'. Reason: Not associated with a trusted SQL Server connection.

In my code, I am using the following to sets up the ConnectionString.

 <appSettings>
    <add key="ConnectionString" value="Server=JAMALONE\VSDOTNET;User ID=IUSR_JAMALONE;Password=sa_48484848;Initial Catalog=WroxJokeShop" />
  </appSettings>

I've been researching this matter for days now. Can someone give me the step by step procedure to fix this problem. Thank you.

Jan
[email protected]
 
Old June 11th, 2003, 03:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

The syntax you're using, with User ID and Password, is for when you want to connect using a SQL Server log-in. If you want to use a Windows log-in like IUSR_machinename then you should replace the User ID and password with "Integrated Security=SSPI". Also, I think the Server=... should be Data Source=...

My connection strings always look like this:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbname;Data Source=servername

hth
Phil
 
Old June 11th, 2003, 11:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Unless you have more of the connection string elsewhere- this connection string won't work.

What's the Data Source? (the server)

How do you know the IUSER password? That's not readily available- in fact, that doesn't look like it would be the IUSR password.

Either use integrated security (which takes the identity of the logged in user) or create a user for data access and provide the information in the connection string. You can also tell IIS to impersonate someone.



Hal Levy
Daddyshome, LLC
 
Old June 11th, 2003, 12:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

To end the connection string debate once and for all (well, at least for now) check out the following sites:

http://www.able-consulting.com/ADO_Conn.htm

and

http://www.connectionstrings.com

Cheers,

Imar
 
Old June 11th, 2003, 03:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please use this connection coding.
give your server name in source data

set cn=server.CreateObject("adodb.connection")
cn.ConnectionString="Provider=SQLOLEDB.1;Integrate d Security=SSPI;Persist Security Info=False;Initial Catalog=dcil;Data Source=AUHTRIPSVR2"
cn.Open


regard.
Mateen


Quote:
quote:Originally posted by Jan_Ma
 I installed Visual Studio .NET 2003, and reinstalled MSDE along with updates including SQL service pack 3a.

I am getting the following error when I try to run my project:
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'SA_48484848IUSR_JAMALONE'. Reason: Not associated with a trusted SQL Server connection.

In my code, I am using the following to sets up the ConnectionString.

 <appSettings>
    <add key="ConnectionString" value="Server=JAMALONE\VSDOTNET;User ID=IUSR_JAMALONE;Password=sa_48484848;Initial Catalog=WroxJokeShop" />
  </appSettings>

I've been researching this matter for days now. Can someone give me the step by step procedure to fix this problem. Thank you.

Jan
[email protected]
 
Old June 11th, 2003, 06:29 PM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please read how I resolved this matter:

First off, thanks to everyone who responded to my inquiry about “Not associated with a trusted SQL Server connection.”

I have been running Visual Studio .NET 2002, and recently installed Visual Studio .NET 2003. It was after the 2003 installation that I ran into trouble with my WroxJokeShop program (program from the book entitled “Beginning ASP.NET E-Commerce”). Prior to the 2003 installation, the WroxJokeShop program ran beautifully.

Today, I had the opportunity to get direct technical support from Microsoft, and the problem has been resolved with the following code changes in the Web.config file.

 <appSettings>
    <add key="ConnectionString" value="Server=jamalone\vsdotnet;integrated security=sspi;Initial Catalog=WroxJokeShop" />
  </appSettings>

  <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> <identity impersonate="true" />

Again, thank you for taking the time to respond to my inquiry, and I will try and post this information on the Website for others to see.
 
Old July 11th, 2003, 10:26 PM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your posting. Really help me!

Diana

Diana
 
Old August 9th, 2003, 05:38 AM
Registered User
 
Join Date: Aug 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Login failed for user 'XP\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'XP\ASPNET'.

Source Error:


Line 14:
Line 15: ' Open the connection
Line 16: connection.Open()
Line 17:
Line 18: ' Return a SqlDataReader to the calling function


Source File: C:\BigECom\WroxJokeShop\BuisnessObjects\Catalog.vb Line: 16

Stack Trace:


[SqlException: Login failed for user 'XP\ASPNET'.]
   System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +484
   System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   WroxJokeShop.Catalog.GetDepartments() in C:\BigECom\WroxJokeShop\BuisnessObjects\Catalog.vb :16
   WroxJokeShop.DepartmentsList.Page_Load(Object sender, EventArgs e) in C:\BigECom\WroxJokeShop\UserControls\DepartmentsLi st.ascx.vb:44
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Page.ProcessRequestMain() +731



I think I am encountering some of the same problems as you are. I ahve also tried soem fo the methods shown here and linsk provided in other websites but I am having still having some problems. I have used exactly the same technique used in the book but I am still having the same problem. I would be grateful if some one can help me


Hari

 
Old August 12th, 2003, 06:22 PM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hari,

You may need to add the info below under your ConnectionString.

<appSettings>
    <add key="ConnectionString" value="Server=jamalone\vsdotnet;integrated security=sspi;Initial Catalog=WroxJokeShop" />
  </appSettings>

This is assuming your using windows integrated login. If not you may need to modify your registry as mentioned on this thread. But, I'm sure you've already done this portion.

I did have the same problems your experiencing. The problem was fixed by modifying the registry for MSQL and adding the "security=sspi" instead of logging in w/ a un and pw for SQL.

Hope this helps!


 
Old August 13th, 2003, 11:54 AM
Registered User
 
Join Date: Aug 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Server Error in '/WroxJokeShop' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 14:
Line 15: ' Open the connection
Line 16: connection.Open()
Line 17:
Line 18: ' Return a SqlDataReader to the calling function


Source File: C:\BigECom\WroxJokeShop\BuisnessObjects\Catalog.vb Line: 16

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +472
   System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   WroxJokeShop.Catalog.GetDepartments() in C:\BigECom\WroxJokeShop\BuisnessObjects\Catalog.vb :16
   WroxJokeShop.DepartmentsList.Page_Load(Object sender, EventArgs e) in C:\BigECom\WroxJokeShop\UserControls\DepartmentsLi st.ascx.vb:44
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Page.ProcessRequestMain() +731




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Thanks for your advice I have done exatcly what you have said including chnging the registry but now the erroe says

that is sql server doesnt exists

Hari






Similar Threads
Thread Thread Starter Forum Replies Last Post
Not associated with a trusted SQL Server connecti yoord BOOK: Beginning ASP.NET 1.0 6 April 15th, 2007 02:48 PM
not associated with a trusted SQL Server Connectio chiefouko SQL Server 2000 4 September 27th, 2006 01:14 PM
Not associated with a trusted SQL Server connectio blajorthemajor SQL Server 2000 0 February 10th, 2006 07:30 PM
not associated with a trusted SQL Server Connectio jamesbie SQL Server 2000 1 February 24th, 2005 04:42 AM
Trusted connection Mary SQL Server 2000 1 August 30th, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.