dc

dc

  • NA
  • 663
  • 0

C# linq count

Oct 4 2012 4:00 PM
I would like help with a linq to sql statement in a C# application. I am trying to count the number of occurences in the
Trans table. I am always getting a count of zero.  There is only one record in the IM and IPack tables but there are 1 to hundreds
of records in the Trans table.

var  varGoodTransCount = (from t in rData.Trans
                                         join iw in rData.Im on t.I_ID equals iw.I_ID
                                         join ip in rData.IPack on iw.PID equals ip.PID
                                         where iw.TNum == PkgID
                                         select new { }).Count();

Thus can  you tell what what you think is wrong with the linq query above? Can you suggest how to change it?

Answers (1)