Tema: MySQL en C#
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/05/2012, 12:12
Avatar de baker1562
baker1562
 
Fecha de Ingreso: marzo-2011
Ubicación: Puntarenas
Mensajes: 261
Antigüedad: 14 años
Puntos: 9
Respuesta: MySQL en C#

Cita:
Iniciado por alexg88 Ver Mensaje
Tienes que usar un while en vez de un if para recorrer las filas del resultado:

Código C#:
Ver original
  1. Comando.CommandText = "SELECT id FROM nombres";
  2.             Comando.Connection = Conexion;
  3.             lector = Comando.ExecuteReader();
  4.            
  5.             while (lector.Read())
  6.                 {
  7.                     txbID.Text = lector["id"].ToString();                
  8.                 }
Muchas grax me sirvio