Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login failed for user 'User1'.Reason Not associated with a trusted SQL

Status
Not open for further replies.

lehuong

Programmer
Sep 2, 2003
98
0
0
US
Hi all,
I remotly accessed to a server and created a database and a user on the microsoft SQL Server (2000). When I tried to access to the database, here is the error

Server Error in '/Member' Application.
--------------------------------------------------------------------------------
Login failed for user 'User1'. Reason: 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 'User1'. Reason: Not associated with a trusted SQL Server connection.
Source Error:

1.This error cause because I am not the admin? (romote login used the terminal client services, the user name and password are provided from the server owner)
2.If yes, how couldn't I access to the database since I have created the database MyDB, the username and password associated to the MyDB (even I created the table userlist)?

Thanks
le
 
Generally this error is caused because the view or stored procs you are referencing does not have the proper rights. You need to give your web account right to the views or stored procs. Either that or you will have get login and password information from you user and pass that along instead of using a trusted connection.
I normally use the following connect string which I keep in the web.config file when using one account for all access to the web site.

<appSettings>
<add key = &quot;ConnectionString&quot; value=&quot;user id=<user name here.;password=<user password here>;initial catalog=<database name here>;data source=<server name here>;Connect Timeout=30&quot; />
</appSettings>

Good Luck!

 
What do you mean by &quot;You need to give your web account right to the views or stored procs.&quot; can you explain it a little clear (Sorry, I'm new to asp .net).
Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top