public List <Socios> ObtenerSocios() { List <Socios> list = new List <Socios>(); using (PgSqlCommand comand = conn.CreateCommand()) { comand.CommandText = "SELECT * FROM socios"; using (PgSqlDataReader dr = comand.ExecuteReader()) { while (dr.Read() == true) { list.Add(new Socios(dr.GetBoolean("administrador"), dr.GetString("nombre"), dr.GetString("contra"), dr.GetInt32("id"))); } dr.Close(); } return(list); } }