How to do a full outer join in Linq?

I think I have the answer here, which is not as elegant as I’d hoped, but it should do the trick: var studentIDs = StudentClasses.Select(sc => sc.StudentID) .Union(StudentTeachers.Select(st => st.StudentID); //.Distinct(); — Distinct not necessary after Union var q = from id in studentIDs join sc in StudentClasses on id equals sc.StudentID into jsc from … Read more

Should I return IEnumerable or IQueryable from my DAL?

It depends on what behavior you want. Returning an IList<T> tells the caller that they’ve received all of the data they’ve requested Returning an IEnumerable<T> tells the caller that they’ll need to iterate over the result and it might be lazily loaded. Returning an IQueryable<T> tells the caller that the result is backed by a … Read more

Which SQL Server field type is best for storing price values?

If you’re absolutely sure your numbers will always stay within the range of smallmoney, use that and you can save a few bytes. Otherwise, I would use money. But remember, storage is cheap these days. The extra 4 bytes over 100 million records is still less than half a GB. As @marc_s points out, however, … Read more

LINQ Between Operator

If you express it as a where clause it may just work out of the box with LINQ to SQL, if you can construct an appropriate expression. There may be a better way of doing this in terms of the expression trees – Marc Gravell may well be able to improve it – but it’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)