Office Document APIs for .NET
ITIL Career Advice
PMP Career Advice
Android Intel XDK
Welcome Guest !
Object reference not set to an instance of an object.. error
on 11/28/2012 |
| Views : 881 | Status :
| Replies : 1
Write New Post
Un Answered Posts
private int m_companyID;
protected void Page_Load(object sender, EventArgs e)
m_companyID = (int)Session["CompanyID"];
Object reference not set to an instance of an object..
i get this when i compile..
Reply with Attachment
The reason is that the program is trying to access a member of a reference type variable which is set to null.
This error happens when you try to use a property or call a method of an object that is null.
A simple use of Visual studio DEBUGGER can tell you the object because of which it is happening. Just look at the stack trace and put a debugger on that line. Check the objects of that line and see if any one is null and you are trying to use that objects property. Handle the same.
Mark as Answer if it helps you
, if this helps please
Mark As Answer
Login to post response
how to resolve it issues
How to resolve this export Issue
How to Solve 'The remote procedure call failed' with reason.
How to sort and paginate the table, Please its very urgent, help me
How to search values while hidden and visible, Please its urgent
How to pass qr image from picture box to RDLC report
What is the advantage of constructor in abstract class c# ?
How to pass values of textbox and combo box to report viewer directly without database