G
Guest
'--this code works but only reads text into one column when contains multiple
cols
Dim ds1x As New DataSet
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dir1A\;Extended
Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn1x As New OleDb.OleDbConnection(ConStr)
Dim dax1 As New OleDbDataAdapter("Select * from testabc1x.txt", conn1x)
dax1.Fill(ds1x, "tbl0")
datagridview1.DataSource = ds1x.Tables("tbl0")
-------------------------------------------------------
The above code works fine for reading text from a textfile and adding it to
a datagridview. My problem is that I have mutiple columns delimited by a
pipe '|', and the code above is not delimiting the text. I get it all in one
column. How to make it delimit the text into multiple columns?
Thanks,
Rich
cols
Dim ds1x As New DataSet
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dir1A\;Extended
Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn1x As New OleDb.OleDbConnection(ConStr)
Dim dax1 As New OleDbDataAdapter("Select * from testabc1x.txt", conn1x)
dax1.Fill(ds1x, "tbl0")
datagridview1.DataSource = ds1x.Tables("tbl0")
-------------------------------------------------------
The above code works fine for reading text from a textfile and adding it to
a datagridview. My problem is that I have mutiple columns delimited by a
pipe '|', and the code above is not delimiting the text. I get it all in one
column. How to make it delimit the text into multiple columns?
Thanks,
Rich