Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there my Name is Edwin

i having a problem with my website i cannot login via my connection string i get a error say:
==================================================================
Login failed for user ";. The user is not associated with a trusted SQL Server connection.

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 ''. The user is not associated with a trusted SQL Server connection.

Source Error:
Line 74:
Line 75: objConnection = New SqlConnection("Data Source=myserverip address,port;Initial Catalog=Matlatladb;Integrated Security=SSPI;User ID=matlala;Password=m@t007;")
Line 76: objConnection.Open()
==================================================================

I asked the company that is hosting my website to change the Authentication to "Windows Authentication Mode (Windows Authentication)" to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
but they told me that they cannot do that since the it will affect other websites on their server.

My question is: Is there a way to get around this, using web config file?
Posted
Updated 5-Oct-10 2:52am
v3

1. Try to dig out this question at www.connectionstrings.com[^]

2. Try to connect with the next connection string:
Data Source=dbserver;Initial Catalog=db;User ID=some user; Password=some password;
 
Share this answer
 
Comments
Sandeep Mewara 5-Oct-10 16:58pm    
Comment from OP:
Hey Pavel Yermalovich ,

i have tried the link you have given me b4 but it seems that my error is not related to the connection string but i am starting to think the issue is relates to user privileges.

so do you have any idea on how to go about it.
I guess User ID=matlala;Password=m@t007; is your windows user ID and password.

Just remove it from your connection string, and add impersonation as the same user in your web.config.

<identity impersonate="true" userName="matlala" Password="m@t007">


:-D Happy coding :-D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900