Click here to Skip to main content
13,042,630 members (78,799 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Updated 2-May-13 18:36pm
Kschuler 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2017
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