When i use the below code to retrieve information, it shows an error..
var mails = from m in entity.mailboxes
join p in entity.ordinary_user_profile_info on m.from_id equals p.user_id
select new MailList
{
mid = m.m_id,
mfrom = m.**from_id,** // Error occours here
mfomname = p.username,
msubject = m.subject
};
Error is:
"int? mailbox.from_id "
Cannot implicitly convert type ‘int?’ to ‘int’. An explicit conversion exists (are you missing a cast?)
I have declared m_id and from_id as int in DB as well as in MailList class.
1 Answer