code :
SqlConnection sqlc = new SqlConnection(
"Data Source=" + Environment.MachineName + @"\SQLEXPRESS;" +
"Integrated security=true;" +
"database=someDB");
SqlCommand sqlcmd;
string tmp = string.Empty;
for(int i = 0; i < 100000; i++)
{
tmp += "inserto into [db].[Files](...) values (...);"
}
sqlcmd = new SqlCommand(tmp, sqlc);
try { sqlc.Open(); sqlcmd.ExecuteNonQuety(); } cathc{}
inserted only < 1000 writes
How write all 100000 writes ?? May be destroy and create sqlcmd?
You should probably split the commands up into smaller commands. Say, inserting 500 records per SqlCommand until you’ve inserted all your records.