Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:36:53+00:00 2026-05-22T19:36:53+00:00

hello i have tried the foollowing code and it is showing only assignment,call increment

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:36:54+00:00Added an answer on May 22, 2026 at 7:36 pm

    If you expect multiple results from the query try this:

    // Calling ToList will force query execution.
    List<Agentlist> result = res.ToList<Agentlist>();
    
    // Calling First will take the first item in the collection.
    // If there are more than one item it will NOT throw 
    // an exception (calling Single() will).
    Agentlist agent = result.First<Agentlist>();
    
    string country = agent.Country;
    

    If you need only the first result of the query you can try calling First() right away:

    Agentlist agent = res.First<Agentlist>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to generate Hello World with openxml sdk. To my surprise when
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
I'm working in the android environment and have tried the following code, but it
I have tried to use the following code to retrieve the data from the
Hello I have tried to post a tweet from my application. When I press
Hello I have tried understanding what is going on in this part of the
I have the following IronPython code. class Hello: def __init__(self): pass def add(self, x,
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello we have an SQL server application running over a low bandwith connection. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.