I\'m creating new threads for every sql call for a project. There are millions of sql calls so I\'m calling a procedure in a new thread to handle the sql calls.
In doing
Nothing mysterious about it, you are using threading, right?
The ++ and -- operator aren't thread safe. Do this.
++
--
public static void processline() { Interlocked.Increment(ref counter); sql.ExecuteNonQuery(); Interlocked.Decrement(ref counter); }