I want to add value from array to each textbox.
Here is my code:
For i as int32 = 0 To Array.length - 1
Me.Controls("TextBox" & i + 1).Text = Array(i)
Next
When I run above code, I got the NullReferenceException error.
Error Line is:
Me.Controls("TextBox" & i + 1).Text = Array(i)
I tried another code after searching from the web,
For i as int32 = 0 To Array.length - 1
Dim c as Control() = Me.Controls.Find("TextBox" & i + 1 , True)
If c.Length = 1 Then
Me.Controls("TextBox" & i + 1).Text = Array(i)
End If
Next
But it still doesn't work. Please help me... Thanks in advanced.