do while... loop
Publicado por Jacqueline (1 intervención) el 03/11/2004 17:02:38
Una un consulta, tengo este codigo, se trata de ubicar uns fechas pero solo me lee la primera file del script como puiedo hacer que si no encuantra su busqueda en la primera fila pueda seguir con la otra y asi hasta que la ubique , trate con un do While pero queda metido el el loop y no sale.
---
Dim resultado As String
Dim lectura As MySqlDataReader
Dim LRegistro As New MySqlCommand("SELECT fecha_ini,fecha_fin,habit_rh FROM TMP_RESERVA_HABITACION WHERE habit_rh='" & aux_habit & "' order by fecha_ini", connection)
'Dim Registro As
lectura = LRegistro.ExecuteReader(CommandBehavior.SingleRow)
If lectura("fecha_ini") <= aux_inicio And lectura("fecha_fin") > aux_inicio Then
habitacion.BackColor = Color.Red
ElseIf lectura("fecha_fin") = aux_inicio Then
habitacion.BackColor = Color.Blue
Else
habitacion.BackColor = Color.Black
End If
lectura.Close()
---
---
Dim resultado As String
Dim lectura As MySqlDataReader
Dim LRegistro As New MySqlCommand("SELECT fecha_ini,fecha_fin,habit_rh FROM TMP_RESERVA_HABITACION WHERE habit_rh='" & aux_habit & "' order by fecha_ini", connection)
'Dim Registro As
lectura = LRegistro.ExecuteReader(CommandBehavior.SingleRow)
If lectura("fecha_ini") <= aux_inicio And lectura("fecha_fin") > aux_inicio Then
habitacion.BackColor = Color.Red
ElseIf lectura("fecha_fin") = aux_inicio Then
habitacion.BackColor = Color.Blue
Else
habitacion.BackColor = Color.Black
End If
lectura.Close()
---
Valora esta pregunta


0