Can I use Parallel.For with sql Commands?
I have a class of range public class avl_range { public long start { get; set; } public long end { get; set; } } If I use a normal FOR works perfect, but have to wait for each command to finish and each query take 8 seconds, so 10 queries take 80 seconds. In the Parallel version If I only print the ranges works perfect, but if try to execute the command say is already in progress. {"An operation is already in progress."} How can I solve this? var numbers = new List<avl_range>(); using (var conn = new NpgsqlConnection(strConnection)) { conn.Open(); Action<avl_range> forEachLoop = number => /