multidimensional array and data table help

S

Steve Arndt

In vb6, I used getrows to load data into a multi-dimensional array. Since
ADO.NET doesn't have getrows, I've succesfully loaded the same data into a
datatable.

How do I reference the data in the data table as a multi-dimensional array
for (row and column), or load the data into an array from the data table?
Or is there a better way to do this?

Thanks
 
C

Cor Ligthert [MVP]

Steve,

A datatable has two main collections
The datacolumns which describe the items
The itemcollection

To iterare you can use both

dim a as String = dt.rows(0)("Item1").ToString

Gives you the ("Item1") in the first row.
(Be aware that those enclosed strings are case sensitive in VB as well.

I hope this helps,

Cor
 
S

Steve Arndt

Can I use this in a loop. Basically what I was previously doing was looping
through an Array row by row setting cell structure in a Flexgrid for certain
cells based on a column number value in an array?
 
S

Steve Arndt

Got it to work...

Thanks

Steve Arndt said:
Can I use this in a loop. Basically what I was previously doing was looping
through an Array row by row setting cell structure in a Flexgrid for certain
cells based on a column number value in an array?

into
 

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

Top