S
Steven Nagy
I know that .NET is based on a disconnected architecture, but I can't
conceive of why continually opening and closing a connection would be
faster than leaving a connection open.
So I ran a test and came up with a result of exactly the same times!
50 rows selected into a datareader, in a loop of 50
One opens and closes the connection in each iteration of the loop, the
other just opens before the loop starts, then closes after the loop is
finished.
62.5 milliseconds for both
So why is this, and which is best? I know MS preaches disconnected, but
I need to know why, then I am converted.
Thanks
conceive of why continually opening and closing a connection would be
faster than leaving a connection open.
So I ran a test and came up with a result of exactly the same times!
50 rows selected into a datareader, in a loop of 50
One opens and closes the connection in each iteration of the loop, the
other just opens before the loop starts, then closes after the loop is
finished.
62.5 milliseconds for both
So why is this, and which is best? I know MS preaches disconnected, but
I need to know why, then I am converted.
Thanks