Hola chicos tengo un problema al ejecutar esta función en NET. cuando abro
la conexion y la cierro, luego voy a SQL Server y ejecuto
sp_who, veo que el usuario esta aún logiado... como si no ha cerrado la
conexión, aparece el siguiente mensaje en SQL Server cuando ejecuto sp_who
"54,0,sleeping ,esoto,ELDER ,0 ,SIAF,AWAITING COMMAND"
Tienen alguna idea que es lo que puedo estar haciendo Mal
Function Login(ByVal strEmail As String, ByVal strPassword As String) As
String
Dim con As New
System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("strCo
nex"))
Dim com As New System.Data.SqlClient.SqlCommand("spUsuariosLogin",
con)
com.CommandType = CommandType.StoredProcedure
com.Parameters.Add("@UserName", strEmail)
com.Parameters.Add("@Password", strPassword)
com.Parameters.Add("@employeeID", SqlDbType.Int, 4).Direction ParameterDirection.Output
con.Open()
com.ExecuteNonQuery()
Dim EmployeeId As Integer CInt(com.Parameters("@employeeID").Value)
If con.State = ConnectionState.Open Then
con.Close() : con.Dispose()
con = Nothing
End If
If EmployeeId = 0 Then
Return ""
Else
Return EmployeeId.ToString()
End If
End Function
Don Quijote de Nicaragua.
Elder Soto.
Leer las respuestas