public void LoadHangHoa() { listViewDSHH.Items.Clear(); dtb = hhbll.LayToanBoThongTinHH(); var hh = dtb.AsEnumerable() .Select(x => new { maHang = x.Field <string>("maHang"), tenHang = x.Field <string>("tenHang"), tenLoai = x.Field <string>("tenLoai"), nSX = x.Field <DateTime>("nSX"), hSD = x.Field <DateTime>("hSD"), soLuong = x.Field <int>("soLuong"), gia = x.Field <int>("gia"), tenNSX = x.Field <string>("tenNSX"), viTri = x.Field <string>("viTri"), }) .ToList(); hh.ForEach(x => { ListViewItem lt = new ListViewItem(x.maHang); lt.SubItems.Add(x.tenHang); lt.SubItems.Add(x.tenLoai); lt.SubItems.Add(x.nSX + ""); lt.SubItems.Add(x.hSD + ""); lt.SubItems.Add(x.soLuong + ""); lt.SubItems.Add(x.gia + ""); lt.SubItems.Add(x.tenNSX); lt.SubItems.Add(x.viTri); listViewDSHH.Items.Add(lt); }); }