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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem connecting to database from code(debug results)

Status
Not open for further replies.

vaichi123

Programmer
Dec 2, 2006
20
US
I am trying to connect to a security database to get the logged on user's rights in my code. However, when I am debugging in the immediate window I get the following error which says could not connect to the database. Where is the problem. The web.config file contains the database connection string.

{Security.SecurityCtl}
AllowDataCache: True
Container: Nothing
DatabaseConnection: "Password=****;Persist Security Info=True;User ID=****;Initial Catalog=DB;Data Source=****"
EncryptionKey: ****
LastErrorMessage: "Cannot open database requested in login 'DB'. Login fails.
Login failed for user '****'."
ObjectCollection: {Security.ObjectTypes}
Password: ""
ProjectIdentity: 1
Site: Nothing
UserId: 0
Username: "XYZ"
UserRights: {Security.UserRights}


**** means there is some value that I have removed
 
Can you connect to it using 'Tools>Connect To Database' in vs.net?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top