Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 August 24th, 2011, 04:42 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile Chap 14 - pg 517 - Item 9 (Object reference not set to an instance of an object. )

Hi Imar,

I'm having trouble after I insert a new name for the NewPhotoAblum.aspx.
Here is part of the error msg:

Server Error in '/Site' Application.
-------------------------------------------------------------------------

Object reference not set to an instance of an object.

[NullReferenceException: Object reference not set to an instance of an object.]
_NewPhotoAlbum.EntityDataSource1_Inserted(Object sender, EntityDataSourceChangedEventArgs e) +61
System.Web.UI.WebControls.EntityDataSourceView.OnI nserted(EntityDataSourceChangedEventArgs e) +112
System.Web.UI.WebControls.EntityDataSourceView.Exe cuteInsert(IDictionary values) +521
System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +89
System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg, Boolean causesValidation) +379
System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean causesValidation, String validationGroup) +611
System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source, EventArgs e) +112
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +125
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) +169
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

I have copied all of your source code from Chap 14 to the Site folder/directory and nothing I've done resolves this error............

Can you suggest something for me to read or try?

Thanks,
 
Old August 24th, 2011, 06:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

AFAIK, that exercise doesn't change the Inserted event (mentioned in the error message), so maybe you accidentally changed something you shouldn't have? Also, the exercise deals with the Manage page, not the New page. Maybe that helps in finding the issue?

If that doesn't help, can you post the relevant code for your pages?

A final thing to check: the database. Make sure you set up the correct tables, columns and primary keys before you create the EF model. If you need to make changes to the database, make sure to recreate the EF model.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 24th, 2011, 07:28 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Question What does AFAIK mean?

Hi There,

What does AFAIK mean?
 
Old August 25th, 2011, 03:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

http://www.google.com/#sclient=psy&h...=1050&bih=1262
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 25th, 2011, 07:59 AM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Default Acronymons

Imar, You don't like CAPITAL LETTERS, I don't like acronynoms, especially if I have look up the definition.

I'm trying to learn vb.net, that's difficult enough.


If you really cared about the people who purchase your books, you should make it as easy as possible for them.

Cheers
 
Old August 25th, 2011, 08:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Sorry? I think I gave you a detailed answer with enough info to figure out what's going on and troubleshoot the problem. In my opinion (although I would have peferred to write IMO) that acronynom didn't really confuse the rest of the message. On top of of that, it's quite a common forum acronynom.

But sorry if I confused you. if you're so touchy, I better not answer other questions from you though.... ;-)

Quote:
If you really cared about the people who purchase your books
Don't I?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Error: Object reference not set to an instance of an object. oruckenan BOOK: Beginning ASP.NET 4 : in C# and VB 2 August 23rd, 2011 02:18 PM
Error - Object reference not set to an instance of an object Phil Critchley ASP.NET 4 General Discussion 2 April 30th, 2011 05:18 AM
Cap 1 pg 33 Oject reference not set to an instance of an object tomche BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 4 December 1st, 2009 02:58 AM
Chap 13 pg448: Object reference not set to an instance of an object tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 15 August 8th, 2009 06:14 AM
Object reference not set to an instance of object iceman90289 ASP.NET 3.5 Basics 1 March 1st, 2009 05:13 AM





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