By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

HELP, The connection string does not work

P: n/a
i am trying to connect to my Sqlserver on my machine.
i tried using the following connection strings

1)

mystring= "Initial Catalog=[SmartLan 2.0 ED];Data
Source=localhost;Integrated Security=SSPI;UID='sa';PWD="
myConn = New SqlConnection(mystring)
myCommand.Connection = myConn
myConn.Open()
myCommand.CommandText = "Select * from agegender"
myCommand.ExecuteXmlReader()

when i execute the connection it says login failed for
'L20935-P3\ASPNET',but i am sure the password is right, i have
verified the password works

i then tried the other option

2)
mystring= "database=[SmartLan 2.0 ED];data source=localhost;user
id=sa;password=;"
..
..
..
when i execute the connection it says login failed for
'L20935-P3\ASPNET' for user sa

i dont know whats going on???
can anyone please help me !!!!!!!!!!!!
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Lloyd,

It looks like you're mixing and matching portions of the connection string
in a way that doesn't work.

You're trying to use both integrated security and the userID/password
method.
"lloyd" <ll***********@rediffmail.com> wrote in message
news:e7**************************@posting.google.c om...
i am trying to connect to my Sqlserver on my machine.
i tried using the following connection strings

1)

mystring= "Initial Catalog=[SmartLan 2.0 ED];Data
Source=localhost;Integrated Security=SSPI;UID='sa';PWD="
myConn = New SqlConnection(mystring)
myCommand.Connection = myConn
myConn.Open()
myCommand.CommandText = "Select * from agegender"
myCommand.ExecuteXmlReader()

when i execute the connection it says login failed for
'L20935-P3\ASPNET',but i am sure the password is right, i have
verified the password works

i then tried the other option

2)
mystring= "database=[SmartLan 2.0 ED];data source=localhost;user
id=sa;password=;"
.
.
.
when i execute the connection it says login failed for
'L20935-P3\ASPNET' for user sa

i dont know whats going on???
can anyone please help me !!!!!!!!!!!!


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.