November 15, 2002 at 1:15 pm
Hi,
I am trying to connect to the LOCAL database on my pc from VB.NET and the code is quite (Visual) basic but keep getting an error message
quote:
login failed for user 'test' Reason:- not associated with a trusted SQL Server connection
- I tried using both Windows authentication and SQL Server authentication in vain. Can some one please help me out?
Thanks in advance
dim conn as sqlclient.sqlconnection
dim strconn as string
try
conn = new sqlclient.sqlconnection()
strconn &= "Data source=(local);"
strconn &= "Initial catalog = Northwind;"
strconn &= "User ID = test;"
strConn &= "password=test;"
conn.connectionstring=strconn
conn.open()
catch oExcept as exception
messagebox.show("Error")
end try
November 15, 2002 at 2:42 pm
Is your local server set for SQL Authentication?
Steve Jones
December 13, 2002 at 7:46 pm
If you go to Enterprise MAnager you can ccheck "Registered sQL server properties" and see if you have windows authentication or SQL Server authentication. Your code requires SQL Server authentication.
Try this code:
dim conn as sqlclient.sqlconnection
try conn = new sqlclient.sqlconnection("Server=(local);UID=test;PWD=test;Database=Northwind")
conn.open()
catch oExcept as exception
messagebox.show("Error")
end try
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy