Linq issue retrieving single value from mssql
Posted
by Anicho
on Stack Overflow
See other posts from Stack Overflow
or by Anicho
Published on 2010-04-16T15:53:14Z
Indexed on
2010/04/16
16:03 UTC
Read the original article
Hit count: 263
Hey Guys, having an issue with linq, I am basically doing the following but it is saying it is "UserProfile does not contain definition for Username" in the current context where I wrote "u.Username" but it does exist I have added UserProfile table to MyDbml.dbml and if I connect to another table it works fine.
TiamoDataContext context = new TiamoDataContext();
var user = (from u in context.UserProfiles
where u.Username == UsernameLabel
select u).FirstOrDefault();
I am flustered by what small detail I have missed out to get this to work, anyone have any clues it would be much appreciation.
© Stack Overflow or respective owner