Remember that an ORM is rarely going to be the right answer to every problem that you encounter. IMHO you want to avoid premature optimization and look elsewhere when it becomes clear that a scenario does not fit in with the chosen paradigm. I do not believe that NHibernate is the right answer for this particular requirement.
I'm not sure if you want to perform a bulk INSERT or a bulk UPDATE. Assuming that the answer is INSERT and that the underlying database in SQL Server 2005 the most performant approach that I have found is (and it's very efficient):
Code:
CREATE TABLE t1
(
c1 int NOT NULL,
c2 int NOT NULL,
c3 int NOT NULL,
c4 varchar (50) NOT NULL,
c5 varchar (50) NOT NULL,
c6 varchar(50) NOT NULL
)
public void BulkInsert()
{
using (SqlCommand cmd = new SqlCommand(@"BULK INSERT t1 FROM 'c:\test_insert.txt'", CONNECTION))
{
using (StreamWriter sw = new StreamWriter(@"c:\test_insert.txt"))
{
for (int i = 1; i <= LOOP_COUNT; i++)
{
sw.WriteLine(i + "\t" + i + "\t" + i + "\t" + i + "\t" + i + "\t" + i);
}
}
cmd.ExecuteNonQuery();
}
}