Read Null values from text file

G

Guest

Hello !

In c# , I am reading values from text files , when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.

How can I check if no value is written before I try to access the value?

Thanks !
 
K

Kevin Spencer

when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.

What array? You didn't mention anything about any array.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
G

Guest

Kevin ,
Thank U for your response!
I have already solve it with this line:

this.yourtextbox.Text.Length != 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top