
Problema con consulta de base de datos
Publicado por Joaquin (1 intervención) el 14/02/2016 23:44:54
Hola, les quería hacer una consulta, tengo un inconveniente con la consulta de una base de datos, hice una aplicación en ASP.NET en Visual Basic y la subí a un host, cuando la ejecuto en el escritorio funciona bien pero al ejecutarla en el host pasa lo siguiente:
Server Error in '/' Application.
ExecuteReader requires an open and available Connection. The connection's current state is closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.
Y el código donde da el error es:
Line 23: Dim cmd As New SqlCommand(sql, conn)
Line 24: Dim dr As SqlDataReader
Line 25: dr = cmd.ExecuteReader
Line 26: If (dr.Read) Then
Line 27: If (dr(0).ToString = txtContrasenia.Text) Then...
El host donde esta la aplicación es www.somee.com y la base da datos esta en sql.
Espero su respuesta, gracias.
Server Error in '/' Application.
ExecuteReader requires an open and available Connection. The connection's current state is closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.
Y el código donde da el error es:
Line 23: Dim cmd As New SqlCommand(sql, conn)
Line 24: Dim dr As SqlDataReader
Line 25: dr = cmd.ExecuteReader
Line 26: If (dr.Read) Then
Line 27: If (dr(0).ToString = txtContrasenia.Text) Then...
El host donde esta la aplicación es www.somee.com y la base da datos esta en sql.
Espero su respuesta, gracias.
Valora esta pregunta


0