Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15476

CSV Helper

$
0
0
I have a VB.Net (Framework 4.7.2) application and a Mysql database. I use Mysql bulkloader to insert just over 1 million lines from .csv file. It takes about 1 minute 46 sec to load. I am trying to use CSV Helper to see if that would be faster (https://joshclose.github.io/CsvHelper/)

Here is the code I use :

Code:

Using streamReader = File.OpenText(extractPath & GebruikHierdieCSV & ".csv")
            Using csvReader As New CsvReader(streamReader, CultureInfo.CurrentCulture)
                    Using dr = New CsvDataReader(csvReader)
                    Dim dt = New DataTable()
                    dt.Load(dr)
                End Using
            End Using
        End Using

However I get an error message : CsvHelper.BadDataException: You can ignore bad data by setting BadDataFound to null.

If I add the following line just after Using csvReader As New CsvReader :

Code:

csvReader.Configuration.BadDataFound = null
I get an error null is not declared. It may be inaccessible due to its protection level.
I have tried DbNull with no luck.

What am I missing?

Viewing all articles
Browse latest Browse all 15476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>