When pooling, or at least assuming that the connection is not closed between calls, is there a difference in network or server performance and how important is it between executing a single stored procedure with multiple result sets and executing multiple stored procedures.
In pseudo code, something like
using(new connection)
{
using (datareader dr = connection.Execute(Command))
{
while (dr.NextResult())
{
while (dr.Read())
{
SomeContainer.Add(Something.Parse(dr));
}
}
}
}
against
using(new connection)
{
using (datareader dr = connection.Execute(Command))
{
while (dr.Read())
{
SomeContainer.Add(Something.Parse(dr));
}
}
using (datareader dr = connection.Execute(Command))
{
while (dr.Read())
{
SomeContainer.Add(Something.Parse(dr));
}
}
}
source
share