I have a console application that reads emails and their attachments. I save the attachments to disc successfully and now I need to update the stock levels of products in my products table from the csv attachment.
I am looking for the best method of doing this as the CSV file has about 8000 and for this supplier we will have only 1000 products to update. So should i add all to a table delete unwanted or from console application read each line if product in csv in my db table insert into temp table or just do the update straight away?
I dont want to cause bottle necks, timouts etc as these files of 3mb will be collected upto every 10 minutes or so.
to read the csv i am looking at these methods:
- http://www.morgantechspace.com/2013/08/how-to-read-data-from-csv-file-in-c.html
- Inserting Records From Csv File To Database Table (SQL Server)
- Import Comma Delimited data into Data Table
Thanks