Dynamic columns in DataSet?

  • Thread starter Thread starter staeri
  • Start date Start date
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
 
Hi staeri,

You can use etiher

myDataRow("Account")

or

myDataRow(column_index)

HTH

Elton Wang
 
Back
Top