public List<HINHANH> SelectHINHANHsAll() { List<HINHANH> list = new List<HINHANH>(); using (LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString)) { ISingleResult<HINHANH_getallResult> lp = db.HINHANH_getall(); foreach (HINHANH_getallResult HINHANH in lp) { HINHANH var1 = new HINHANH(); var1.MaHinhAnh = HINHANH.MaHinhAnh ; var1.DuongDan = HINHANH.DuongDan ; var1.MaAlbum = HINHANH.MaAlbum ; list.Add(var1); } try { // Save the changes. db.SubmitChanges(); } // Detect concurrency conflicts. catch (ChangeConflictException) { // Resolve conflicts. db.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges); } } return list; }