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 :
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 :
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?
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
If I add the following line just after Using csvReader As New CsvReader :
Code:
csvReader.Configuration.BadDataFound = null
I have tried DbNull with no luck.
What am I missing?