Hi again, :o

I have a little problem with a type of value, I would like to know what type is it, because when I try to see how long is it I have an error that says: "Object reference not set to an instance of an object".

When I show the content of the value in a messagebox <MessageBox.Show(Tls.Tasa)>, it doesn't show anything, it looks like it were a blank, then I have the error above.

What can I do with this error? How can I catch it correctly?
or How can I identify the type of value for making a validation?

Thanks a lot.

Hi,

It seems that you try to get the type of a reference to an object which isn't instantiated. For example "Button b;" will declare but won't instantiate the button; but "Button b = new Button();" would instantiate it too. If you need to check the type of objects where some of them might not be instantiated by purpose, then first check if they are NULL. "if (b != NULL) { /* Your stuff here*/ }"

Loren Soth

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.