Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Bulk Copy
Message
De
25/05/2012 06:41:58
 
 
À
24/05/2012 07:00:03
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01544244
Message ID:
01544376
Vues:
22
For anyone interested I overcame the problems populating the DataTable using OleDb by replacing the OleDB processing with a streamreader as shown below.
Private Function RetrieveSourceData2() As DataTable
        Dim sourcedata As New DataTable
        Dim sr As New StreamReader("C:\TEMP\X1.CSV")
        Dim line As String = sr.ReadLine()
        Dim value As String() = line.Split(vbTab)
        Dim row As DataRow
        For Each dc As String In value
            sourcedata.Columns.Add(New DataColumn())
        Next
        Do While Not sr.EndOfStream
            If value.Length = sourcedata.Columns.Count Then
                row = sourcedata.NewRow()
                row.ItemArray = value
                sourcedata.Rows.Add(row)
            End If
            value = sr.ReadLine.Split(vbTab)
        Loop
        Return sourcedata
    End Function
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform