private void StartImport()
{
SqlBulkCopy bulkCopy = new SqlBulkCopy("Server=ServerName;Database=test;Trusted_Connection=True;",
SqlBulkCopyOptions.TableLock);
bulkCopy.DestinationTableName = "dest table Name";DataTable dt = CreateDataTableFromFile();
bulkCopy.WriteToServer(dt);
}
private DataTable CreateDataTableFromFile()
{//create a datatable and fill it with the values from the grridview
return the Datatable;
}
No comments:
Post a Comment