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
- Next message: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Previous message: Richard Lionheart: "DB connection problem in attemp to load DataGrid from SQLServer DB"
- In reply to: Richard Lionheart: "DB connection problem in attemp to load DataGrid from SQLServer DB"
- Next in thread: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Reply: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Reply: Richard Lionheart: "My current settings are "SQL Server and Windows NT"."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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 > > >
- Next message: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Previous message: Richard Lionheart: "DB connection problem in attemp to load DataGrid from SQLServer DB"
- In reply to: Richard Lionheart: "DB connection problem in attemp to load DataGrid from SQLServer DB"
- Next in thread: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Reply: Richard Lionheart: "Re: DB connection problem in attemp to load DataGrid from SQLServer DB"
- Reply: Richard Lionheart: "My current settings are "SQL Server and Windows NT"."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|