blah blah blah is here! blah blah » Close

up0down
link

I'm carrying a value from one form to another, it nearly works but i'm getting the following error: System.NullReferenceException was unhandled

The line of code throwing the error is:

NewApp.textBox1.Text = ap.ResourceIndex.ToString();


How do i handle the null value on the above?

last answered one month ago

2 answers

up0down
link

Ah, after some playing around i noticed it was the entry in my DB. Ooops.

up1down
link

I can thing about those options how you can do it too


ap.ResourceIndex.ToString()==null || ap.ResourceIndex.ToString()==""
or
ap.ResoureceIdex.ToString().Lenght==0

Thanks, I'll keep that in mind.

Feedback