Reading CSV File and Store its content to SQL DB (LINQ and WCF)

Hi anyone know how to read csv file and store its content to sql db using LINQ and WCF, I read few articles but i can’t able to comprehend. I am looking for a beginner tutorial.
Below are the articles I found:

  1. http://www.codeproject.com/Articles/24561/Integrating-LINQ-to-SQL-queries-within-a-WCF-Servi
  2. http://www.dotnetfunda.com/articles/article706-how-to-read-csv-file-and-import-its-data-with-linq.aspx

You could start off with a .net console app or a web app anything that is convenient. The code will be the same in WCF.
It’d be a good idea to split your requirements & then go for it. something like
1 read a file from the disk.
2 have that file in a datatable , generic list or something like that.
3 save a datatable/ List to a database

To get started , here’s how you can read a fie using LINQ.


 var mycsv =  from x in File.ReadAllLines("D:\\\\mycsvfile.csv") select x;

Only tricky part is parsing the CSV here – check out FileHelpers, it solves that for you.

You probably want to skip WCF if you are just reading a CSV file and stuffing it in a database. Unless the database is on a remote host.