i'm trying to import a .csv file using the great FileHelpers library. Doing some research most of the time i read that i should use BulkCopy to import the result into an SQL database table.
Could you please help me how to accomplish this? So far i have this:
public void ImportCSV()
{
string path = @"C:\...\...\...\TestCSV\";
var engine = new FileHelperEngine<Customer>();
var result = engine.ReadFile(path + "test3.csv");
engine.WriteFile(path + "FileOut.csv", result);
}
and a mapping class:
public class Customer
{
public string Feld1;
public string Feld2;
public string Feld3;
public string Feld4;
}
this works but i don't know how instead of writing the result in a new .csv file i can use an SQL table (i know this has been discussed before but i can't find a solution that's working for me so far) Thanks in advance for your help