Looping

  • Thread starter Thread starter VB Novice Hendri
  • Start date Start date
V

VB Novice Hendri

Guest
I have a Data Tabel with 50 similary named Colums, "Con1 to Con50"

Most of the time not all will be used.

I need a simple way to count the ones that has data in before creating labels in an arry.

I tryed this so far, please help.

Dim recipeSelected As String = TitleListBox.SelectedItem.ToString()
Dim result = recipesLst.Where(Function(x) x.RecipeName = recipeSelected).FirstOrDefault()
'Form1.TextBox1.Text = result.ID.ToString()

Dim ContentCountVar As Integer
Dim ActiveContent As String = "Con" & ContentCountVar.ToString

For ContentCountVar = 1 To 50
If ActiveContent = Nothing Then
MsgBox("Nothing")
Else
ContentCount = ContentCount + 1
End If
Form1.TextBox1.Text = ContentCount.ToString
Next ContentCountVar

Continue reading...
 

Similar threads

V
Replies
0
Views
130
VB Novice Hendri
V
V
Replies
0
Views
102
VB Novice Hendri
V
V
Replies
0
Views
116
VB Novice Hendri
V
Back
Top