Login failed for user 'sa'. C#, SqlServer 2000

G

Guest

This is driving me nuts. I have found plenty of newsgroups that discuss this
subject and not one of them helped. I have tried multiple connection strings
to connect to a database on another computer. The current string
erver=hostMachine;Database=hostDatabase;User ID=sa;Password=hostPassword
produces the following error:

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

So I tried another string using "Trusted_Connection=Yes" which produces an
error that user 'null' was not trusted.

SqlServer is currently setup to use SqlServer and Windows authentication,
which is why I don't understand why providing the username and password for
the server would return that error. I also double checked and reset the
password in enterprise manager and that still did not help. I'm at my wits
end so any assistance would be appreciated. Thanks in advance.
 
R

Raul Cortes

JUST GUESSING:

If the other computer has a firewall (like the one installed after WinXP
sp2),
it could have port 1433 closed, so yo wold not comunicate whith the
SQL server.

Hope it helps....
 
G

gabe garza

If you're currently setup for SqlServer and Windows authentication then use
Query Analyzer to login using sa and your password for sa.
If you get the same problem then SQL Server isn't setup for SqlServer
authentication, it's only setup for Windows authentication.

If you're able to login using Query Analyzer then post the actual code (not
just the connection string) that you're using, something is wrong with that
code.
 
G

Guest

I will give that a try, thanks. In the meantime I moved the database to
another computer and everything worked fine. Once I get this project
finished up I will go back and check the sql settings on the first computer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top