Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 24th, 2005, 01:03 PM
Registered User
 
Join Date: Feb 2005
Location: Toronto, Ontario, Canada.
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

  #2 (permalink)  
Old March 24th, 2005, 03:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
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
  #3 (permalink)  
Old March 25th, 2005, 07:32 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
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!
  #4 (permalink)  
Old March 25th, 2005, 10:53 PM
Registered User
 
Join Date: Feb 2005
Location: Toronto, Ontario, Canada.
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

  #5 (permalink)  
Old March 28th, 2005, 02:13 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
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)


 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08: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



All times are GMT -4. The time now is 12:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.