Best way to load data from a CSV file into an ADO.Net DataSet

Smarties 1 Reputation point
2022-01-25T16:34:11.45+00:00

Hi,

There's a CSV file, 300k lines, a daily export from an ERP system.
It lives on a network drive.
I need to loop through the 300k lines, analyse, and make decisions (do stuff).
Once in an ADO.Net DataSet I'm off and running.

Do I read the CSV file line by line, split each line based on the known delimitator, and add the fields into a DataTable row by row, or is there a more elegant way with OLE DB for example?

I don't have the experience to know what is the 'right' way to do this.
I'm keen to start 'right', first time!

Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,327 questions
{count} votes