Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/10/2009, 10:39
therealzeta
 
Fecha de Ingreso: octubre-2009
Mensajes: 46
Antigüedad: 14 años, 11 meses
Puntos: 1
Conexion vb.net Mysql

Hola:

Tengo el siguiente codigo que me da el error. Alguien podria ayudarme.

An unhandled exception of type 'System.InvalidOperationException' occurred in MySql.Data.dll

Additional information: Connection must be valid and open.


Imports MySql.Data.MySqlClient

Public Const Cadena As String = "Database=Gas;Data Source=localhost;User ID=root;Password=tyu;"

Dim conexion As New MySqlConnection(Cadena)
conexion.Open() '' Hasta aqui me funciona bien por lo asumo que se conecta.

Dim Ocomando As New MySqlCommand("sp_test")
Dim oDataReader As MySqlDataReader
Ocomando.ExecuteReader() '' Aqui salta el error

El store procedure funciona bien en sql.


Gracias de antemano