When selecting data for a custom object from a LINQ to SQL Left Join, how can I specify a default for an attribute that may sometimes be null?

Seems to me the problem might be in your where clause: where qtu. UserID == UserID Since when the DefaultIfEmpty kicks in, your qtu object will not contain a valid UserId.

Bingo! Thanks man – Ryan Mar 14 at 14:36.

I think qtu. Defaultifempty will return null for the default value, so the fact that you aren't reporting an exception when you check qtu. Userid suggests that you may be left joining on the wrong table.It means that, in the data you are testing, all questions have a question tracking.

I don't know the structure of your db, but maybe you could try outer joins for the other joins as well? (sorry for lack of formatting, the mobile site doesn't have formatting buttons).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions