Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/06/2013, 07:13
panquitaro
 
Fecha de Ingreso: marzo-2013
Mensajes: 25
Antigüedad: 11 años
Puntos: 0
Pregunta Combobox por defecto en Consulta SQL

Estimados
De mi DB hago una consulta y aparece en mi combobox:

Código:
   cturno.CommandType = CommandType.Text
        cturno.CommandText = ("Select TIPO_DEMORA from TIPO_DEMORA")
        cturno.Connection = (con)
        If (con.State = ConnectionState.Closed) Then con.Open()
        vturno = cturno.ExecuteReader
        While vturno.Read = True
            CmbPTipoDemoras.Items.Add(vturno.Item(0))

        End While
        con.Close()
Pero cuando indico que aparesca el item 1 por Defecto con el sgte codigo:


Código:
cturno.CommandType = CommandType.Text
        cturno.CommandText = ("Select TIPO_DEMORA from TIPO_DEMORA")
        cturno.Connection = (con)
        If (con.State = ConnectionState.Closed) Then con.Open()
        vturno = cturno.ExecuteReader
        While vturno.Read = True
            CmbPTipoDemoras.Items.Add(vturno.Item(0))

        End While
        CmbPTipoDemoras.SelectedIndex = 0
        con.Close()

Lo ubica en el item 1 pero pararece el siguiente mensaje:


"there is already an open Datareader associated with this command witch must be closed first."

y segun google traductor quiere decir :
"ya hay un DataReader abierto asociado a esta bruja de comandos se debe cerrar primero."

Como hago para que no aparesca ese error???

saludos