In a C# 2008 windows application, I have the following linq to sql statement that points to a sql server 2008 r2 database. The following query returns null. But there are records to be fetched.
//Code
string SubmissionPkgID = "valid string value";
var varGoodTransCount = (from t in rData.Transactions
join iw in rData.Ibooks on t.ImportID equals iw.ImportID
join ip in rData.IPackages on iw.PID equals ip.PID
where (ip.trc_num != null) && ip.trc_num == SubmissionPkgID
group ip by ip.trc_num into g
select new { trc_num = g.Key, Frequency = g.Count() }).FirstOrDefault();
Note: SubmissionPkgID does contain a valid value. Where i'm worng?