Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals 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 9th, 2009, 10:40 PM
Authorized User
 
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Post Object reference not set to an instance of an object.

Hello verybody !

I have taken more time to check the code.I know that it work fine on my localhost but on the work it does not work. in few month ago, it still work fine.I do not why i met this error.

If you have know about this, please help me to fix this,
Thanks all things
Best Regards
Phuc Hoang
 
Old August 9th, 2009, 11:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Without code, is hard to tell you anything about the problem.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old August 9th, 2009, 11:26 PM
Authorized User
 
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 30: object [] parvalue = {0,pageIndex,10};
Line 31: SqlDbType [] sqldbType = {SqlDbType.Int,SqlDbType.Int,SqlDbType.Int};

Line 32: DataTable dt = NData.DTProccess._getDT("spResSelect", parName, parvalue, sqldbType, ref total);
Error here
Line 33: dlRes.DataSource = dt;
Line 34: dlRes.DataBind();
 
Old August 11th, 2009, 03:30 AM
Registered User
 
Join Date: Sep 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hi.huangls
Default

Check your database whether connected the server.
 
Old August 11th, 2009, 09:11 PM
Authorized User
 
Join Date: Dec 2007
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default

I have also checked database (that run in the localhost) by access the IP.It work fine.
I do not why i met this eror

Thanks for relying me
Phuc Hoang
 
Old August 14th, 2009, 10:56 AM
Authorized User
 
Join Date: Aug 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to amitranjan286 Send a message via Yahoo to amitranjan286
Default

You are getting a null reference exception that means something is coming null out of the db. Put a breakpoint here and add watch for all possible values.
Also replicate the existing database with localhost database where your are getting exception.
Some time while parsing if you are getting 0 , then it will throw the same exception





Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Object Reference not set to an instance of object srinivas_chakka ASP.NET 1.0 and 1.1 Professional 0 February 8th, 2006 11:56 AM
Object Reference is Not Set to an Instance of an O blackinwhite General .NET 4 February 1st, 2005 05:42 AM





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