When using DataReaders, and in this example Response.Write (but I guess it would apply to any Controls), does slow clients affect number of connections? The average connection pool usually has about max 15 connections. So if 100 users hit the application and 50 of them have very slow connections with high latencies, will the number of connections exceed the maximum number of connections?
If using a DataTable, I'd imagine that all the data is loaded into memory so the connection isn't left open while doing the Response.Write.
Example:
using(SqlDataReader reader = DataUtility.GetReader("select * from employees"))
{
while(reader.Read())
{
Response.Write(reader["emp_id"]).ToString();
Response.Write(reader["username").ToString();
}
}
vs
DataTable emps = DataUtility.GetDataTable("select * from employees");
foreach(DataRow row in emps.Rows)
{
Response.Write(row["emp_id"]).ToString();
Response.Write(row["username").ToString();
}