There is a really good library called FileHelpers , which is a) 100% free, b) completely in C #, and it can easily import any text file - separated by commas, separated by tabs, fixed width, etc.
You should not have a problem with this to load the CSV file into objects in memory and save them to SQL Server using ADO.NET.
FileHelpers , , . "" ( , ).
:
FileHelperEngine<Customer> engine = new FileHelperEngine<Customer>();
Customer[] dataLoaded = engine.ReadFile(fileName);
, , ( ), , SQL-:
using(TransactionScope ts = new TransactionScope())
{
foreach(Customer c in dataLoadad)
{
SaveCustomer(c);
}
ts.Complete();
}
DataTable SqlBulkCopy SQL Server - !
UPDATE:
[DelimitedRecord] BlackListDevice?