Dynamic columns in DataSet?

S

staeri

I'm looping through a DataSet with this code:

Dim myDataRow As DataRow

For Each myDataRow In myDataSet.Tables("ReportRows").Rows
Dim row As WorksheetRow = sheet.Table.Rows.Add
cell = row.Cells.Add

cell.Data.Text = myDataRow("Account").ToString()
Next

I want to get the values from each column also without knowing their
name. In the code above I get the value from the Account column but I
want a dynamic solution where I don't write the name of the column. Is
that possible?

Regards,

S
 
G

Guest

Hi staeri,

You can use etiher

myDataRow("Account")

or

myDataRow(column_index)

HTH

Elton Wang
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top