Reputation: 695
I'm using an OleDbDataReader to loop through my imported excel file and it gets everything in the file except for the first row. How can I specify that I want to see this header row?
strSQL = "SELECT * FROM [" & firstSheetName & "]"
Dim myCommand As New OleDbCommand(strSQL, myConnection)
Dim myDba As OleDbDataReader
myDba = myCommand.ExecuteReader
s = ""
While myDba.Read()
For i = 0 To myDba.FieldCount - 1
s &= myDba.Item(i) & vbTab
Next
s &= vbCrLf
End While
Upvotes: 1
Views: 826
Reputation: 6289
You should specify that your spreadsheet doesn't have header: HDR=No .
Upvotes: 1