public static List <Cl> Mostrars() { List <Cl> lista = new List <Cl>(); MySqlConnection conexion = BDcomun.ObtenerConexion(); MySqlCommand comando = new MySqlCommand(string.Format("Select idClientes, ApellidoP, ApellidoM, RFC from clientes "), conexion); MySqlDataReader reader = comando.ExecuteReader(); while (reader.Read()) { Cl cli = new Cl(); cli.ApellidoP = reader.GetString(1); cli.ApellidoM = reader.GetString(2); cli.RFC = reader.GetString(3); lista.Add(cli); } conexion.Close(); return(lista); }