Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/12/2013, 13:04
Avatar de pcarvajal
pcarvajal
 
Fecha de Ingreso: enero-2002
Mensajes: 701
Antigüedad: 23 años, 1 mes
Puntos: 8
Pregunta .net2005+oracle: ExecuteReader error

Desde un formulario en vb.net, estoy tratando de rescatar un campo desde un sp que está en oracle. El código que tengo es el siguiente:

I
Código SQL:
Ver original
  1. Imports System.DATA.OleDb
  2. ...
  3.  
  4. Dim oraConn AS String = "Provider=MSDAORA; Data Source=(DESCRIPTION=" _
  5.            + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=99.99.99.99)(PORT=9999)))" _
  6.            + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));" _
  7.            + "User Id=XXXXXX;Password=XXXXXX;"
  8.  
  9.             Dim conn AS NEW OleDb.OleDbConnection(oraConn)
  10.  
  11.             Dim SQL AS String = "SpGestionLeerXRutFecha '" & cRut & "'"
  12.             Dim cmd AS NEW Imports System.DATA.OleDb
  13.  
  14. OleDb.OleDbCommand(SQL, conn)
  15.             cmd.CommandType = CommandType.Text
  16.  
  17.             Dim dr AS OleDb.OleDbDataReader = cmd.ExecuteReader() ' Visual Basic
  18.            dr.Read()
  19.  
  20.            MsgBox(dr.Item("NTIDGES"))
  21.  
  22.            conn.Close()
  23.            conn.Dispose()

Pero me arroja el siguiente error:
Error: ExecuteReader requiere de una conexion abierta y disponible. El estado actual de la conexion es cerrada


Que puede ser?????????