Home All Groups Group Topic Archive Search About

How to read a csv file into DataTable

Author
8 May 2006 10:38 AM
ad
I have a .csv file.
How can I read it into DataTable?

Author
8 May 2006 10:46 AM
Cor Ligthert [MVP]
Ad,

If you look two messages below you see my answer on that.

Cor

Show quote
"ad" <fly***@wfes.tcc.edu.tw> schreef in bericht
news:ui$rRuocGHA.3900@TK2MSFTNGP05.phx.gbl...
>I have a .csv file.
> How can I read it into DataTable?
>
Author
8 May 2006 12:02 PM
ad
Thanks,
But I can't find your answer.



Show quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:%23uvXbxocGHA.2***@TK2MSFTNGP03.phx.gbl...
> Ad,
>
> If you look two messages below you see my answer on that.
>
> Cor
>
> "ad" <fly***@wfes.tcc.edu.tw> schreef in bericht
> news:ui$rRuocGHA.3900@TK2MSFTNGP05.phx.gbl...
>>I have a .csv file.
>> How can I read it into DataTable?
>>
>
>
Author
8 May 2006 1:27 PM
Cor Ligthert [MVP]
Do you not see a message from Tomb?

Show quote
"ad" <fly***@wfes.tcc.edu.tw> schreef in bericht
news:en7uMdpcGHA.4932@TK2MSFTNGP03.phx.gbl...
> Thanks,
> But I can't find your answer.
>
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl>
> ¼¶¼g©ó¶l¥ó·s»D:%23uvXbxocGHA.2***@TK2MSFTNGP03.phx.gbl...
>> Ad,
>>
>> If you look two messages below you see my answer on that.
>>
>> Cor
>>
>> "ad" <fly***@wfes.tcc.edu.tw> schreef in bericht
>> news:ui$rRuocGHA.3900@TK2MSFTNGP05.phx.gbl...
>>>I have a .csv file.
>>> How can I read it into DataTable?
>>>
>>
>>
>
>
Author
8 May 2006 2:25 PM
Paul Clement
On Mon, 8 May 2006 18:38:32 +0800, "ad" <fly***@wfes.tcc.edu.tw> wrote:

¤ I have a .csv file.
¤ How can I read it into DataTable?
¤

        Dim TextConnectionString As String
        TextConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
              "Data Source=" & "e:\My Documents\TextFiles" & ";" & _
              "Extended Properties=""Text;HDR=NO;"""

        Dim TextConn As New System.Data.OleDb.OleDbConnection(TextConnectionString)
        TextConn.Open()

        Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from test.csv", TextConn)

        Dim ds As DataSet = New DataSet("CSVFiles")
        da.Fill(ds, "TestFile")

    '...
    '...

        TextConn.Close()


Paul
~~~~
Microsoft MVP (Visual Basic)

AddThis Social Bookmark Button