Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Trying to connect asp.net and sql database

Author  Topic 

Jay123
Yak Posting Veteran

54 Posts

Posted - 2009-11-22 : 17:36:20
I created a sql database in visual web devoloper and am trying to set up a conection.
i keep getting the message:

System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection

now i read a forum which says i must switch from windows authentication mode to Mixed mode.

no i am doing this by right clicking on data connections then add connection.

i point to the right database but when i try to set the username and passeord. it says:

Login faile for user jay.

it doesnt matter what i put i always get the same result:

(login failed for user [userName]).

test connection will only work if i set authentication mode to windows.

How do i change it to mixed mode.


Thanks Jay

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-11-23 : 04:57:34
Login to Sql Server Management Studio as windows authentication mode, right click on your server name and select properties, on left side of properties panel click on tab "SECURITY", and on right side you can see Server Authentications radio buttons, select radio button with caption "Sql Server and Windows Authentication Mode"
Go to Top of Page

Jay123
Yak Posting Veteran

54 Posts

Posted - 2009-11-24 : 08:49:41
There seems to be no option.

I get two choices:

1. windows authentication mode.

2. sql server & windows authentication mode.

How do i change it.
Is there a way to change it only for one database
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-11-24 : 10:25:45
Change it to the 2nd option.

also this post should have been in the .net forum.

Also, when you said you created a db, was the db put in the app_data folder ? if thats the case, what you expect would be different from what you get in manangement studio
Go to Top of Page

Jay123
Yak Posting Veteran

54 Posts

Posted - 2009-11-24 : 15:19:48
Yes it is in app data folder.

i have tried both options. both with same results.

also how do i conect a already existing database(created in sql 2005).
Go to Top of Page
   

- Advertisement -