Wrox Programmer Forums
|
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2005, 02:03 PM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 17 - DataGrid Sorting Example

Hello:

I am working on the DataGrid Sorting Example and recieve the following error when I load up the webpage:

Login failed for user 'ADAIR001\ASPNET'.

I am not sure what the problem is. Here is the connection string I am using to connect to the 'pubs' db:

objConnection = New SqlConnection("Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI")

This is the same connection string I used for the binding examples in Chapter 16(windows forms) and everything was well. What could be the problem?

thx,
tim

 
Old March 24th, 2005, 04:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Your application is running as the ADAIR001\ASPNET user account, which doesn't exist ing the database you are connecting to. Add that to the database and give it dbo permissions.

Brian
 
Old March 25th, 2005, 08:32 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same problem. It looks like IIS uses the username ASPNET. Since I am using the MSDE I am not show I can add a new user APSNET to the database as dbo. It seems MSDE has only one user account "sa". Can any one help ? please!
 
Old March 25th, 2005, 11:53 PM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Brian,

Thanks for the response. I am a newbie to MSDE and .NET and am not quite sure how to add 'ADAIR001\ASPNET' to the db and give it permissions. Will have to look into that, but if anyone can help me out by posting the solution or a link to useful info that would be greatly appreciated.

Also, I am puzzled by the fact that I was allowed access to the database when using Winforms. Why do I need permissions all of a sudden to use Webforms?

tim

 
Old March 28th, 2005, 03:13 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I resolved this issue by not so hardway. Reinstall MSDE so that SQL authentication is used instead of Windows and reattach the pubs database. I used the following command while reinstalling the MSDE.

setup INSTANCENAME="InstanceName" SECURITYMODE=SQL SAPWD="AStrongSAPwd"

Now in the code use the user id and password as used above, and it works.

Another way to fix the issue as Brian mentioned is to use a tool call SQL Web Administrator and add make the ASPNET as dbo (I didn't try this solution)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 17 - Datagrid Updates Project ydv BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 December 27th, 2005 09:06 AM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM
Another Chapter 17 problem (DataGrid Update) bolibompa BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 3 May 11th, 2004 12:32 PM
DataGrid Updates BLANK PAGE (Chapter 17) happyhorseygal BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 April 8th, 2004 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.