Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Bulk Copy
Message
From
25/05/2012 06:41:58
 
 
To
24/05/2012 07:00:03
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01544244
Message ID:
01544376
Views:
21
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
Previous
Reply
Map
View

Click here to load this message in the networking platform