Re: DB connection problem in attemp to load DataGrid from SQLServer DB

From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 09/14/05


Date: Tue, 13 Sep 2005 18:53:52 -0500

It looks like your SQL Server is configured to accept only trusted
connections. You can either change it to allow both SQL Server and Windows
or change your connection string to specify Windows authentication
('Integrated Security=SSPI' instead of userid and password).

Be sure not to use the 'sa' login for routine application access.

-- 
Hope this helps.
Dan Guzman
SQL Server MVP
"Richard Lionheart" <NoOne@Nowhere.net> wrote in message 
news:Of2OhjLuFHA.3500@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I originally (and mistakenly) posted this on 
> microsoft.public.dotnet.framework.windowsforms  I hope this time I've 
> posted it on more appropriate newsgroups.
>
> I'm trying to run Jeff Prosise's DataGrid example in Chapter 6 of
> "Programming Microsoft .NET".
>
> Jeff provided a MyComics.sql file which I've used in Query Analyzer to
> create and populate a MyComics database in SQLServer 7.0 installed with NT
> authentication.  I verified that the table had been loaded correctly with 
> a
> Select statement.
>
> IE displayed the following info:
>
> ============================
> Exception Details: System.Data.SqlClient.SqlException: Login failed for 
> user
> 'sa'. Reason: Not associated with a trusted SQL Server connection.
>
> Source Error:
>
> Line 70:
> "server=localhost;database=mycomics;uid=sa;pwd=xxxxx");
> Line 71:           DataSet ds = new DataSet ();
> Line 72:           adapter.Fill (ds);
> Line 73:           MyDataGrid.DataSource = ds;
> Line 74:           MyDataGrid.DataBind ();
>
> Source File: f:\inetpub\wwwroot\DataGrid-Prosise.Comics.aspx    Line: 72
> ================================
>
> I exex out the password.  I'm quite sure the password I had supplied was 
> correct for the "sa" account.
>
> I suspect the problem is a conflict between my specification of NT 
> authentication and the example's use of the "sa" user.  I also tried 
> removing the uid/pswd to no effect.
>
> Any ideas?  Should I post this stuff in some security NG instead?
>
> Thanks in advance,
> Richard
>
>
> 


Relevant Pages

  • Getting to the bottom of MSDE network connection problems ...
    ... but other than that it is MSDE 2000 with sp3a already applied. ... I've finally figured out the connection problems associated with this, ... and it seems the problems are due to Windows XP and not MSDE. ... the enterprise/standard versions of SQL server won't install ...
    (microsoft.public.sqlserver.msde)
  • Re: Windows Authentication in asp.net 2005 to SQL Server?
    ... If the domains do not trust each other, Windows authentication is not going ... Basic authentication sometimes makes the need for Kerberos delegation go ... generic account to do the backend data stuff on our SQL Server. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Remote connection failed
    ... If you are going over a remote connection or are not logging ... into the domain where SQL Server is then no, Windows ... authentication won't work. ...
    (microsoft.public.sqlserver.connect)
  • Re: Changing passwords / Blocking SA login attempts
    ... I went into the Server Config properties and changed to Windows ... My login for Start and Run SQL server was in this format. ... I am supposing this was an SQL authentication, ...
    (microsoft.public.sqlserver.security)
  • Re: Bizzare SQL Network Error
    ... The bizzare thing is that, the same connection string, the same code to ... In a windows APP it works fine, in a Web APP I get ... >>I am trying to connect to a default instance of SQL Server 2000 Enterprise ...
    (microsoft.public.dotnet.framework.adonet)