Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Login Failed for User '(null)'. In .NET Windows Ap

Author  Topic 

vemulavijay
Starting Member

32 Posts

Posted - 2004-12-02 : 20:31:42
I have developed a .NET windows application, which is supposed to connect to SQL server 2000 on another system.

If SQL server 2000 exists in XP system, all queries from my system are getting executed well. But when the SQL server 2000 exists in Win 2K system, it throws an error saying that:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

My SQL server is in Mixed Authentication Mode(SQL Server and Windows). And this problem exists even if both the systems are in same domain or different.

Can anybody throw some light on it Please. Thank you very much.

Regards,
Vijay

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-02 : 20:36:38
You can get this error if you do not explicitly specify an Integrated Security entry in the connection string, or if you don't specify a User ID and Password.
Go to Top of Page

vemulavijay
Starting Member

32 Posts

Posted - 2004-12-02 : 20:50:54
thanks robvolk,

my connection string is as follows:

connection = new System.Data.SqlClient.SqlConnection();
connection.ConnectionString = "integrated security=SSPI;data source=myserver; persist security info =False;Trusted_Connection= yes;initial catalog=mydb; User id = myName; Password =mypwd;

But Still it does not work. Please identify the problem.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-02 : 21:22:44
You cannot specify both Integrated security AND a user id and password. Take the user id and password out and see if that works.
Go to Top of Page

vemulavijay
Starting Member

32 Posts

Posted - 2004-12-02 : 22:10:24
hi robvolk,

i removed used id and password. but still it does not work. let me give a better picture. i have 3 systems(A,B,C) with sql server 2000 installed( all 3 are servers). A,B systems have windows 2000 professional operating system and C systm has XP professional. The application which i have developed works fine if i try to connect to sql server in win2000(B) from XP(C). but the same application if i install it in system A and try to access sql server in system B ,it is giving the above mentioned error.

how it can give error as the exe is same. do i have to take care of some security issues in win2000?

regards,
vijay.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-03 : 02:35:15
try this
quote:

connection = new System.Data.SqlClient.SqlConnection();
connection.ConnectionString = "provider=sqloledb;data source=myserver;initial catalog=mydb; User id = myName; Password =mypwd;






--------------------
keeping it simple...
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2004-12-03 : 14:14:46
Also make sure you are not allowing Anonymous logins in IIS.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page
   

- Advertisement -