Problemas con sqlconnection

10/07/2006 - 21:15 por Guillermo | Informe spam
Al intenar ejecutar un codigo que me genera un reporte en excel me aparece
este error de la conneción a la base dedatos que carga los datos en mi
dataset, antes de llevarlos a excel

System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
used and max pool size was reached.

at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(sqlConnectionString options, Boolean&
isIntransaction)

at System.Data.SqlClient.SqlConnection.Open()

at SecMantInd.modFunction.Con(String Str) in C:\Seguridad y Mantenimiento
Industrial\SecMantInd\modFunction.vb

Preguntas similare

Leer las respuestas

#1 Jesús M.I
14/07/2006 - 02:54 | Informe spam
Cn.Open
pun
pun
pun
Cn.close
Tienes q cerrar conexion

"Alberto Poblacion" escribió:

Mostrar la cita
#2 Alberto Poblacion
14/07/2006 - 07:46 | Informe spam
"Jesús M.I" wrote in message
news:
Mostrar la cita
Exactamente ese puede ser el problema. Si uno de los "pun" da un error,
o si hace un return, la rutina se sale sin hacer el Close. Si eso te pasa
varias veces, se agotan las conexiones del pool. La forma de evitarlo es
esta:

Cn.Open
Try
pun
pun
pun
Finally
Cn.Close
End Try
#3 Harvey Triana
14/04/2010 - 15:30 | Informe spam
Using(SqlConnection ... )
{ punt, etc.}

Es una opcion mas elegante
<Harvey Triana />
http://vexpert.mvps.org


"Alberto Poblacion" wrote:

Mostrar la cita
Ads by Google
Search Busqueda sugerida