G
Guest
The datareader below contains two rows of two columns but in the for loop,
the values for only the first row are getting printed twice. How do I get to
the values of the second row? Thanks. -hazz
Dim dTable As DataTable
Dim dsBlock As New DataSet
Dim rowBlock As DataRow
Dim myColumn As DataColumn
Dim iCol As Integer = 0
dTable = dsBlock.Tables.Add("BlockInfo")
While DataReader.Read
rowBlock = dTable.NewRow()
rowBlock(0) = DataReader.Read.Item(0)
rowBlock(1) = DataReader.Read.Item(1)
dTable.Rows.Add(rowBlock)
End While
For iRow= 0 To dTableBlockInfo.Rows.Count - 1
For Each myColumn In dTable.Columns
PrintValue(iRow , iCol, rowBlock(myColumn))
iCol = iCol + 1
Next
Next
the values for only the first row are getting printed twice. How do I get to
the values of the second row? Thanks. -hazz
Dim dTable As DataTable
Dim dsBlock As New DataSet
Dim rowBlock As DataRow
Dim myColumn As DataColumn
Dim iCol As Integer = 0
dTable = dsBlock.Tables.Add("BlockInfo")
While DataReader.Read
rowBlock = dTable.NewRow()
rowBlock(0) = DataReader.Read.Item(0)
rowBlock(1) = DataReader.Read.Item(1)
dTable.Rows.Add(rowBlock)
End While
For iRow= 0 To dTableBlockInfo.Rows.Count - 1
For Each myColumn In dTable.Columns
PrintValue(iRow , iCol, rowBlock(myColumn))
iCol = iCol + 1
Next
Next