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 : 873 | 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 close the respective modal dialog when switch over to other modal dialog without overlapping
how to save and use variable in jquery
How to add Parameterized Image in RDLC report?
How to Solve this Hosting Issues.
How do i get payment status in redirect page using bitpay?
What is autocomplete in input tag ?
How to pass parameters from html page to constructor of a class in C#
DropDownList Validation not working inside Gridview