0

~ error says image seen below i don't know why is it? is there another way to pick up the data without the error? i'm using distinct or group by.

var query = (from i in SFC.TransacRRrecords where i.POPRCTNM == p 
                         group i by new {
                             i.VendorID,
                             i.VENDNAME,
                             i.SUBTOTAL,
                             i.PymtrMID,
                             i.TRUCKNO,
                             i.REMARKS,
                             i.VPNum,
                             i.VPDate,
                             i.AmountInWords
                         } into grp
                select new
                {
                    Vcode = grp.Key.VendorID,
                    Vdesc = grp.Key.VENDNAME,
                    Vsubtotal = grp.Key.SUBTOTAL,
                    Vterms = grp.Key.PymtrMID,
                    Vtruckno = grp.Key.TRUCKNO,
                    Vremarks = grp.Key.REMARKS,
                    Vvpno = grp.Key.VPNum,
                    Vvpdate = grp.Key.VPDate,
                    Vamntword = grp.Key.AmountInWords
                }).FirstOrDefault();                
                ListViewItem List = new ListViewItem(query.Vcode);
                List.SubItems.Add(query.Vdesc);
                List.SubItems.Add(string.Format("{0:n2}", query.Vsubtotal));
                List.SubItems.Add(query.Vterms);
                List.SubItems.Add(query.Vtruckno);
                List.SubItems.Add(query.Vremarks);
                List.SubItems.Add(query.Vvpno);
                List.SubItems.Add(query.Vvpdate);
                List.SubItems.Add(query.Vamntword);

                deletedRRHeaderList.Items.AddRange(new ListViewItem[] { List });

Error Message Image

4

0 回答 0