T
tshad
I am reading in a .csv file like so:
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
If f.Exists(path & "allocation.csv") Then
Dim da2 As New OleDb.OleDbDataAdapter("Select * from " & "allocation.csv",
conn)
da2.Fill(DTDepartment)
End If
The data looks like:
TOM SMITH T,088,310,0.25
LARRY JONES T,099,310,0.75
....
2 PROBLEMS.
1) if I had the same thing, but with titles so my columns had titles, is
there a way to tell it to use the 1st row as column titles?
2) is there a way to tell it that the 2nd column is text and not numeric, so
it doesn't drop the leading zero (088 is becoming 88 in my datatable).
Thanks,
Tom
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
If f.Exists(path & "allocation.csv") Then
Dim da2 As New OleDb.OleDbDataAdapter("Select * from " & "allocation.csv",
conn)
da2.Fill(DTDepartment)
End If
The data looks like:
TOM SMITH T,088,310,0.25
LARRY JONES T,099,310,0.75
....
2 PROBLEMS.
1) if I had the same thing, but with titles so my columns had titles, is
there a way to tell it to use the 1st row as column titles?
2) is there a way to tell it that the 2nd column is text and not numeric, so
it doesn't drop the leading zero (088 is becoming 88 in my datatable).
Thanks,
Tom