开发者

LinqToSql returns null when using Single - not sequence contains no elements [duplicate]

This question already has answers 开发者_开发百科here: Closed 13 years ago.

Possible Duplicate:

Linq help - Sql trace returns result, but datacontext returning null

Question 1579164

I tried changing to .Single instead of .SingleOrDefault and the object I get back is null, not 'sequence contains no elements' error. When I use SQL profiler and capture the SQL that is generated, I run the query and get 1 result. What would cause the object to be null?

Thanks for any help, ~ck


perhaps your field/properties mapping in your DBML is not correct

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜