hello i have tried the foollowing code and it is showing only assignment,call increment and new object expression can be uesd as a statement
var res = from results in db.JobSearchAgents
where results.SiteID == 110 && results.UserID == sess
select new Agentlist
{
JobSearchAgentID = results.JobSearchAgentID.ToString(),
EmailAddress = results.EmailAddress,
Keywords = results.Keywords,
Country = results.Country,
zipcode = results.ZipCode,
miles = results.Miles.ToString(),
IsActive=results.IsActive.ToString()
};
string country= (new ObservableCollection<Agentlist>(res))[0].Country);
please give me the soluttion
If you expect multiple results from the query try this:
If you need only the first result of the query you can try calling
First()right away: