Getting data in one column

S

sags

Hi ,
Iam a new uesr of this group.
I have a small doubt . Iam using the code mentioned below to retrive
the data from tab delimited text file ., but Iam getting all the
columns of the text file in one data grid column.


Dim file As String = "test.txt"
Dim path As String = "C:\"
Dim ds As New DataSet("Textfiles")
Try
Dim f As System.IO.File
Dim a = path & file
If f.Exists(path & file) Then
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended
Properties=""Text;HDR=yes;FMT=Delimited;"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da As New OleDb.OleDbDataAdapter("Select * from " &
file, conn)
da.Fill(ds, "test.txt")
End If
Catch ex As Exception

End Try

Can anybody tell me Y Iam getting the .txt data in one column only.

Thanks
Sags
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top