private void Ejecutar() { StringBuilder sbQuery = new StringBuilder(); sbQuery.Append("select secuencia,linea,usuario,cia,time(fecha) as hora,date_format(fecha,'%d/%m/%Y') as fecha,"); sbQuery.Append("message,programa"); sbQuery.Append(" from errors"); sbQuery.Append(" where secuencia = '" + txtNoError.Text + "'"); MySqlConnection oCnn = new MySqlConnection(this.cCadenaConexion); MySqlCommand oCmd = new MySqlCommand(sbQuery.ToString(), oCnn); MySqlDataReader Lector; oCnn.Open(); Lector = oCmd.ExecuteReader(); if (Lector.Read()) { txtNoError.Text = Lector.GetString("secuencia"); txtCompania.Text = Convert.ToString(Lector.GetDecimal("cia")); //txtFecha.Text = Convert.ToString(registro["fecha"]); txtFecha.Text = Convert.ToDateTime(Lector.GetString("fecha")).ToLongDateString(); txtHora.Text = Lector.GetString("hora"); txtLinea.Text = Lector.GetString("linea");; txtUsuario.Text = Lector.GetString("usuario");; txtPrograma.Text = Lector.GetString("programa");; txtMensajeError.Text = Lector.GetString("message");; } oCnn.Close(); }