I am currently trying to export data from a excell db to a vb.net and create some for loops so I can generate data from it.

anyway I got the whole thing working apart from I cant get the list box to show all the data in the column instead of just one value.

column1string = ds.Tables("query1").Rows(0).Item(0)
        pupilfore1.Items.Add(column1string)

If I try and change Rows(0) to something like
Rows(0, 100) or Rows(0-100) it just says it can't handle more than one integer

can anyone help with this please?
thanks

Why dont you just make it a varable and run a loop?

for x = 0 to ds.Tables("query1").Rows.count-1
column1string = ds.Tables("query1").Rows(x).Item(0)
pupilfore1.Items.Add(column1string)
next


not sure of the
"ds.Tables("query1").Rows.count-1"
you might use length.

thanks I sorted it, I did the following

For Count = 1 To 267
            column1string = ds.Tables("query1").Rows(Count).Item(0)
            pupilfore1.Items.Add(column1string)
        Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.