Parameter | Details |
---|---|
cnn | Your database connection, which must already be open. |
sql | Command to execute. |
param | Object to extract parameters from. |
transaction | Transaction which this query is a part of, if any. |
buffered | Whether or not to buffer reading the results of the query. This is an optional parameter with the default being true. When buffered is true, the results are buffered into a List<T> and then returned as an IEnumerable<T> that is safe for multiple enumeration. When buffered is false, the sql connection is held open until you finish reading allowing you to process a single row at time in memory. Multiple enumerations will spawn additional connections to the database. While buffered false is highly efficient for reducing memory usage if you only maintain very small fragments of the records returned it has a sizeable performance overhead compared to eagerly materializing the result set. Lastly if you have numerous concurrent unbuffered sql connections you need to consider connection pool starvation causing requests to block until connections become available. |