User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,576 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,243 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 14504 | Replies: 5
Reply
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

SQL not a trusted connection?!

  #1  
Jun 16th, 2004
Hi all, I'm getting this error when I try to link to my SQL database .

Login failed for user 'test' Reason: Not associated with a trusted SQL Server connection.

any ideas what I'm doing wrong?
Formerly known as Slade.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: New York
Posts: 862
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Rep Power: 12
Solved Threads: 15
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: SQL not a trusted connection?!

  #2  
Jun 18th, 2004
What's your connection string?
-Ryan Hoffman

ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: SQL not a trusted connection?!

  #3  
Jun 20th, 2004
I've fixed it now... I used the "Trusted_connection=yes;" now it said login failed for user DOMAIN\ASPNET so I just made an account called ASPNET Althought I would have liked to see if I could make it so it logged in using my sql authentication...


My connection String is:
<add key="strSqlConnectionString" value="server=localhost;database=sladesfaculty;Trusted_Connection=yes;" />
Formerly known as Slade.
Reply With Quote  
Join Date: Feb 2002
Location: New York
Posts: 862
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Rep Power: 12
Solved Threads: 15
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: SQL not a trusted connection?!

  #4  
Jun 20th, 2004
"Server=.;Database=sladesfaculty;User ID=username;Password=password"

^ Should work fine. Also, you need to make sure your SQL Server is set for SQL Server Authentication (and not just Windows Authentication). Just because you've made SQL Server Authentication usernames and passwords doesn't mean its set properly.

In SQL Server Enterprise Manager, right click on your server, and go to properties. On the "Security" tab, make sure the "SQL Server and Windows" radio button is selected.

FYI, the "." is a shortcut for localhost in an SQL Server connection string .
-Ryan Hoffman

ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote  
Join Date: Mar 2004
Location: Brisbane
Posts: 632
Reputation: Slade has a spectacular aura about Slade has a spectacular aura about 
Rep Power: 7
Solved Threads: 6
Slade's Avatar
Slade Slade is offline Offline
Practically a Master Poster

Re: SQL not a trusted connection?!

  #5  
Jun 20th, 2004
that was my original string. I also used sql & windows authentication but it didn't work, not even when I have the username and password as my actual windows authentication... it still said it wasn't a trusted connection. Any ideas?
Formerly known as Slade.
Reply With Quote  
Join Date: Feb 2002
Location: New York
Posts: 862
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Rep Power: 12
Solved Threads: 15
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: SQL not a trusted connection?!

  #6  
Jun 24th, 2004
If you want to use Windows authentication in ASP.NET, you can't just put in your DOMAIN\USER and password. You need to enable a trusted connection and use identity impersonation on your web application (or enable the ASPNET account on your database).
-Ryan Hoffman

ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:55 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC