if your using MS SQL Server you can use the BulkInsert command. and MDSN search on BulkInsert .Net 2.0 should point you in the right direction. There have also been posts on these forums about it as well. In summary it would look something like this:
ResultSet fields = new ResultSet(3);
fields.DefineField(DetailTableFields.Column1, 0);
fields.DefineField(DetailTableFields.Column2, 1, AggregateFunction.Sum);
fields.DefineField(DetailTableFields.Column3, 2, AggregateFunction.Max);
IGroupByCollection grouping = new GroupByCollection();
grouping.Add(ableFields.Column1);
IPrediateExpression filter = new PredicateExpression(DetailTableFields.Column2 > 100);
DataTable results = new DataTable();
string cnn;
using(DataAccessAdatper adapter = new DataAccessAdatper())
{
cnn = adapter.ConnectionString;
adapter.FetchTypedList(fields, results, filter, 0, null, null, false, grouping);
}
using (SqlBulkCopy copy = new SqlBulkCopy(cnn))
{
//begin sql transaction
//configure field mappings and sql bulk copy options if necessary
try
{
copy.DestinationTableName = "headerTable";
copy.WriteToServer(table);
//commit
}
catch
{
//rollback
}
}