all groups > sql server connect > july 2003 >
You're in the

sql server connect

group:

Newbie Connection String Issue.. SQL Server 2000


Newbie Connection String Issue.. SQL Server 2000 Brent
7/24/2003 1:19:55 PM
sql server connect:
Hi,

I'm running SQL Server 2000 that came with Office XP
developer. I am trying to connect to a default instance
of SQL Server through a C# file using the SQLConnection
object.

ie,
SqlConnection cn;

cn = new SqlConnection
("server=xxx;uid=sa;pwd=zzz;database=Northwind;" );

My OS Is Windows XP Pro, and I have IIS running to serve
up the ASPX page I am compiling.

The error I get is:

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

Has anyone ever seen this problem? Is there a procedure I
can follow to properly connect? (Do I need to set up some
account information in Windows AND SQL server?) My SQL
Query Analyzer has no problem connecting to my database
using my current Windows Admin account, but when I try to
use this Admin account, it too gives the same error. I've
searched the net for an explanation for this, but nothing
I've tried has worked.

Any help is greatly appreciated,

Newbie Connection String Issue.. SQL Server 2000 Brent
7/24/2003 2:32:55 PM
Wouldn't you know it, after 8 hours of banging my head
against the wall, all I had to do was enable mixed-mode
authentication in SQL Server. I guess connecting through
a C# compiled file is not the same as by normal Windows
Authentication.

Hope this helps anyone else having this problem.

[quoted text, click to view]
Re: Newbie Connection String Issue.. SQL Server 2000 Dinesh.T.K
7/24/2003 5:00:50 PM
Brent,

You were passing "uid=sa;pwd=zzz;" and 'sa' is a SQL Server login.Since your
authentication was set as 'Windows Only', connection was not possible.

--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com

[quoted text, click to view]

Re: Newbie Connection String Issue.. SQL Server 2000 Le
7/24/2003 8:25:58 PM
Dinesh, I am having the same problem...

So what is the solution? A newbie as well here...

[quoted text, click to view]
Re: Newbie Connection String Issue.. SQL Server 2000 Dinesh.T.K
7/25/2003 8:53:08 AM
Le,

Brent mentioned the solution.I was just justifying it.

[quoted text, click to view]

--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com

[quoted text, click to view]

Re: Newbie Connection String Issue.. SQL Server 2000 L M
7/25/2003 12:28:44 PM
it worked.

thanks for your help and patience!

--LM
Developer learning the DB Trade :)

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button