public static QueQuan ReadQueQuan(SqlDataReader reader) { var qq = new QueQuan() { ID = reader.GetInt32(iID), TenDiaPhuong = reader.GetString(iTenDiaPhuong) }; return(qq); }
public static List <QueQuan> DSQueQuan() { var lqq = new List <QueQuan>(); var cm = CreateCommand(); cm.CommandText = @"SELECT * FROM QueQuan"; var reader = cm.ExecuteReader(); while (reader.Read()) { lqq.Add(QueQuan.ReadQueQuan(reader)); } cn.Close(); return(lqq); }