Fastest way to load data from a csv stream into access
Posted on 2012-03-28
I have a stream of CSV data that I need to load into an access table. The table is initially blank and this will be the only process running. There are a few values in the input CSV data that need to be cleaned (dates need to be formatted and some strings need to be escaped).
Currently I have the data in a CSVReader and read the data one line at a time and create a OleDbCommand and set the CommandText for the insert. I then .ExecuteNonQuery to add the single line to the database and then read the next line from the reader and repeat.
Is there a faster way to get the data into access?