Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
while filling a datatable from a csv files those columns while contaion mixed datatype e.g. text,numeric in csv file, are coming as blank in datatable

below is the code that i m using
Dim csvFileFolder As String = _PATH
            Dim csvFileName As String = _FILE
        Dim connString As String = &quot;Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=&quot; _
            &amp; csvFileFolder &amp; &quot;;Extended Properties=&quot;&quot;Text;HDR=No;FMT=Delimited&quot;&quot;&quot;
        Dim conn As New Odbc.OdbcConnection(connString)
        'Open a data adapter, specifying the file name to load
        Dim da As New Odbc.OdbcDataAdapter(&quot;SELECT * FROM [&quot; &amp; csvFileName &amp; &quot;]&quot;, conn)
        'Then fill a data table, which can be bound to a grid
        Dim dt As New DataTable
Posted 1-May-13 22:37pm
Edited 2-May-13 19:36pm
Kschuler at 2-May-13 12:17pm
Without seeing the data that the csv contains and your code, we really don't have enough information to help you. Please click the Improve Question link and add more information to your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 455
1 Sergey Alexandrovich Kryukov 445
2 Maciej Los 290
3 ProgramFOX 275
4 CHill60 225
0 OriginalGriff 550
1 Sergey Alexandrovich Kryukov 470
2 Maciej Los 310
3 ProgramFOX 275
4 Peter Leow 250

Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100