Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 17th, 2009, 10:40 AM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default Problem on Compile

Downloaded the Chapter 12 code, to get a better understanding of completed code. Sorry I learn in reverse.

I am getting a compile error in Controls/PTORequests.ascx.cs


cgvPTORequests.LoadMethodParameters.Add(((BasePage)Page).CurrentUser.ID);
NullReferenceException was unhandled by user code.

I have setup the db and changed my an account to match my domain information.
What am I missing? This seems to be a common problem within the VS environment.

Thanks
  #2 (permalink)  
Old March 17th, 2009, 12:37 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

Went back to the basics,

1. Deleted Existing db and solution files.
2. Ran SQL Script to setup db
3. Open Chpt 12 Solution

On compile I got db access errors, which I am able to understand and overcome.
After I got them resolved, Compiled again. I thought I had it but it points right back to the above error. Am I missing something in the book?

It thinks the value is null. What db information is it looking for?

This is about as far as my comprehension for this error goes. It could be so many different possibilities. Anyone else willing to try my steps to reproduce?

Thanks
  #3 (permalink)  
Old March 17th, 2009, 03:23 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

So still doing digging and have come to the conclusion that something in the db connection string may be the cause for this problem.

I will give you more insight into the SQL permissions errors that I got earlier.

The first one I got after initial setup is:

Cannot open database "HRPaidTimeOff" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

I know this is the account that windows uses to authenticate when Integrated Security is turned on.
Should I not be using Integrated Security?

What I did to get around the SQL permissions issue, was grant it CRUD permissions after adding it as a user to the HRPaidTimeOff db.

It no longer notifies me of db connection issues, but instead gives the message from the first post.

Thanks
  #4 (permalink)  
Old March 18th, 2009, 11:54 AM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

I was able to resolve my problem.

Turns out after thinking about it more in depth, it was an issue with my IIS configuration.

As noted above the line of code I pointed out was receiving a null value. After eliminating he cause being related to the db and code, I began to trace the permission access.

Sure enough it was.

What I did to resolve this was, disable anonymous access, then enable digest authentication so IIS will look at the domain. In the realm area select or type your fully qualified domain and this should work.

Excellent book, I have learned more from this one book about how to properly use .NET and a great foundation on code reuse.

Thanks
  #5 (permalink)  
Old March 18th, 2009, 09:17 PM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Sorry I didn't see this post earlier. I knew what it was right away. The application uses the user's window's logon to find them in the ENTUserAccount table. If anonymous access is turned on the Page.User.Identity.Name property returns NULL. Enabling windows authentication fixes the issue.
 


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
Compile problem wrox-pix-web marshad77 BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 0 July 1st, 2008 11:01 AM
Chapter 18 code compile problem warlock7 BOOK: Ivor Horton's Beginning Visual C++ 2005 8 January 3rd, 2008 09:04 AM
Ex9_16 Compile Problem DugD BOOK: Ivor Horton's Beginning Visual C++ 2005 1 July 9th, 2006 04:21 AM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM
How Compile the First Example ? AlexPerusso BOOK: Beginning Visual C++ 6 3 April 8th, 2005 10:44 AM



All times are GMT -4. The time now is 11:59 PM.


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