Monday, March 26, 2012

how to connect to a local sql server on your laptop?

i have problems connecting to the local server on my laptop. i ahve used the following code but it gives me an error saying login flaied for user "sa" or "sekhar".

i tried using the username and password i use to log onto my computer. but it doesnt work.
can anyone tell me how to do it?

the code is typed is

connection = new sqlconnection("server=localhost;uid=sekhar;pwd=sekhar;database=chandu")
..................
.............................
........................
connection.open()..............i have all the next statements correct.
my username is sekhar and the password is sekhar too but it gives me an error.
somebody help me

Thank you

sekhartry using server=(local)

and whether you need the password or not depends on how the SQL Server is set up. does the users view show a user called 'sekhar'? no? when you right click the server node and go to properties->security, does it show windows auth only, or Windows and SQL Server auth?

No comments:

Post a Comment