Bug : Object reference not set to an instance of an object [closed]
Object reference not set to an instance of an object.
i am getting this error on line by line validation.can any one help me.............?
It means you're trying to dereference a null reference. Something like this:
string text = null;
int length = text.Length;
Without seeing any code, it's impossible for us to advise you any further. Basically, find out which reference is null and work out how to handle it or prevent it occurring.
You are trying to use an uninitialized variable in your code.
Make sure all variables are initialized before using them:
string x = null;
x.Replace(' ', 'x'); // Exception: Object reference not set to an instance of an object.
string y = "This is a test";
y.Replace(' ', 'x'); // No problem, y = "Thisxisxaxtest"
精彩评论