Looping a dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How do I continue a loop if a null or blank value is found? This is part of
my code

For i = 0 To iRowCount

sStore = dsi.Tables(0).Rows(i)(0)

If sStore.Empty then goto next

ComboBox1.Items.Add(sStore)


Next


So if the value of sStore is Null, Empty or blank then move to the next line
and continue the loop. The dataset is populated from an excel file.

Thanks
 
For i = 0 To iRowCount
If Not IsDBNull(dsi.Tables(0).Rows(i)(0)) Then
sStore = dsi.Tables(0).Rows(i)(0)
ComboBox1.Items.Add(sStore)
End If
Next
 

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

Back
Top