Click here to Skip to main content
11,802,442 members (70,570 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB 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 = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" _
                & csvFileFolder & ";Extended Properties=""Text;HDR=No;FMT=Delimited"""
            Dim conn As New Odbc.OdbcConnection(connString)
            'Open a data adapter, specifying the file name to load
            Dim da As New Odbc.OdbcDataAdapter("SELECT * FROM [" & csvFileName & "]", conn)
            'Then fill a data table, which can be bound to a grid
            Dim dt As New DataTable
Posted 1-May-13 21:37pm
Edited 2-May-13 18: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 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,645
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web01 | 2.8.151002.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