G
Guest
I am using MS Application Block code, have writtent the following code:
===========================================
using (SqlConnection sqlCon = new SqlConnection ("SomeConnstring"))
{
string strQuery = @"SELECT count(*) FROM MyTable";
iCount = Convert.ToInt32 (SqlHelper.ExecuteScalar
(sqlCon,CommandType.Text, strQuery));
sqlCon.Close ();
}
===========================================
Although here, the connection is being closed and subsequently disposed in
the using {} block, this doesnt seem to work in an asp.net page and after
some time it gives an error saying that not enough conenctions in the
connection pool.
However the same code seems to work just fine in a windows form application .
How come? Is it a known issue with asp.net / iis that it connection pools
are not freed on time?
Any clues????
===========================================
using (SqlConnection sqlCon = new SqlConnection ("SomeConnstring"))
{
string strQuery = @"SELECT count(*) FROM MyTable";
iCount = Convert.ToInt32 (SqlHelper.ExecuteScalar
(sqlCon,CommandType.Text, strQuery));
sqlCon.Close ();
}
===========================================
Although here, the connection is being closed and subsequently disposed in
the using {} block, this doesnt seem to work in an asp.net page and after
some time it gives an error saying that not enough conenctions in the
connection pool.
However the same code seems to work just fine in a windows form application .
How come? Is it a known issue with asp.net / iis that it connection pools
are not freed on time?
Any clues????