connecting MS SQL DB problem?

javalaya

New member
Joined
Jul 31, 2008
Messages
1
Programming Experience
Beginner
hi,

i am having problem on connecting ms sql db. i don't know what i am missing or what i m doing wrong.

i have WinXP and ms sql 2000 installed my pc. i haven't changed the password for sa, it is blank i think.

when i want to test the connection from following ASP.NET code it gives error.
VB.NET:
<%

  Dim myDataReader as SqlDataReader
  Dim mySqlConnection as SqlConnection
  Dim mySqlCommand as SqlCommand
  
  
  mySqlConnection = new SqlConnection("server=localhost;database=dbname; uid=sa;pwd=")
  mySqlCommand = new SqlCommand("SELECT * FROM pubs", mySqlConnection)
  mySqlConnection.Open()
  
  %>

ERROR
Line 19: mySqlConnection.Open()

[SqlException: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.]

anyone can guide me?

Do i need to any other setting like DataSource setting in the WinXP control panel?
 
It seems to me that you installed your SQL Server with Windows Mode which does not support username/password authentication. To use this type of authentication, install your SQL Server with Mixed Mode (some people call it SQL mode).
 
Back
Top