Click here to Skip to main content
Rate this: bad
good
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 = "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
            da.Fill(dt)
Posted 1-May-13 22:37pm
(unknown member)
Edited 2-May-13 19:36pm
v2
Comments
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 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2014
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