Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 February 14th, 2009, 02:06 PM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default A small problem with the code from CH06 and with next ones.

Hello,

I've bought this book (an excellent one).

Unfortunately in chapter 06 (a role-base security) I have a problem with the code.
I changed in table ENTUserAccount an user with ID=1 for "a correct MyUser which is a dbo" and I did correct a connection string but I still have an error on an url (for instance):
http://localhost/PaidTimeOffUI/Admin...istration.aspx

System.NullReferenceException

" in a row 101: of the ENTMenuItemBO.cs"
....
a row 99: {
a row 100: //Check if this user is in this role
a row 101: if (role.RoleUserAccounts.IsUserInRole(userAccount.ID ))
a row 102: {
a row 103: //Try to find the capability with the menu item Id.
....

Any ideas .
(I using VS 2008 Team System, MS SQL 2005 Std on Vista Ultimate and Integrated Security in MS SQL)
 
Old February 14th, 2009, 10:54 PM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Hello Jeremie,

The WindowsAccountName in the ENTUserAccount table should be changed to the windows account name that you logged on as, i.e. ComputerName\YourName. This is not a SQL Login account.

You also need to make sure Integrated Windows Authentication is checked for your website in IIS. The web site is using the current windows identity to find a matching user in the ENTUserAccount table.

Please let me know if this helps,
Vince
 
Old February 15th, 2009, 07:40 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile A small problem with the code ...

Hello Mr Vincent Varallo,

Thanks a lot for your attention.

I did a correct an account (domain\username) but it was a problem connected with "a disabling an anonymous authentication in IIS 7".

I thought that I did it (in Vista is done in a different way than in W2003).

Of course all examples are correct.

Good job this book!
Jeremy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with a small piece of code (New to VB) kwik10z Excel VBA 2 October 12th, 2007 06:46 AM
ch06-xmldistilled not open humayunlalzad BOOK: Beginning XML 3rd Edition 3 February 13th, 2007 09:35 AM
small C++ game code PLEASE HELP!!! ands122 C++ Programming 2 June 18th, 2005 04:55 PM
CH06\SwitchCase.aspx mdonald BOOK: Beginning ASP.NET 1.0 0 December 8th, 2004 07:38 PM
small problem harjinder_x XSLT 0 March 23rd, 2004 05:43 AM





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