In the case of many records (more than 8,000 cases), use DataReader
SqlDataReader Dr = cmd.executeReader (Commandbehavior.CloseConnection);
/ / This representative is automatically closed when the DR is turned off.
While (Dr.Read ())
{
....... Use the loop to bind DR's data to HTMLTABLE.
}
Dr.close ();
This is much faster than DataSet.