Albeit new to VB.NET, I've done this several times before, but today
I've run into an interesting problem. I am trying to loop through a
datareader and display the data in a spreadsheet. So far, I only get 1
row to display. (I know it has multiple rows)
Here's the code for the loop:
xlRow = "4"
With reader
.Read()
Do While .HasRows
xlSheet.Cells(xlRow, 1) = .Item("emp_name")
xlSheet.Cells(xlRow, 2) = .Item("dt_filed")
xlSheet.Cells(xlRow, 3) = .Item("dt_check")
xlSheet.Cells(xlRow, 4) = .Item("g_type")
xlSheet.Cells(xlRow, 5) = .Item("g_desc")
xlSheet.Cells(xlRow, 6) = .Item("totPay")
xlSheet.Cells(xlRow, 7) = .Item("dept")
xlSheet.Cells(xlRow, 8) = .Item("union_name")
xlRow = xlRow + 1
.NextResult()
Loop
End With
reader.Close()
I appreciate any help.