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

  • Home
  • SEARCH
  • 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 8942977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:39:40+00:00 2026-06-15T11:39:40+00:00

Can someone guide me on to repairing the error on this query : var

  • 0

Can someone guide me on to repairing the error on this query :

       var objApps = from item in xDoc.Descendants("VHost") 
                          where(from x in item.Descendants("Application"))
                          select new clsApplication
                       {
                           ConnectionsTotal = item.Element("ConnectionsTotal").Value
                       };

It displays a compiler error “A query body must end with a select clause or a group clause”. Where am I going wrong?

Would appreciate any help..

Thanks.

Edit : Here is my XML(haven’t closed the tags here)…I need the connectioncount values inside the Application..

    - <Server>
  <ConnectionsCurrent>67</ConnectionsCurrent> 
  <ConnectionsTotal>1424182</ConnectionsTotal> 
  <ConnectionsTotalAccepted>1385091</ConnectionsTotalAccepted> 
  <ConnectionsTotalRejected>39091</ConnectionsTotalRejected> 
  <MessagesInBytesRate>410455.0</MessagesInBytesRate> 
  <MessagesOutBytesRate>540146.0</MessagesOutBytesRate> 
- <VHost>
  <Name>_defaultVHost_</Name> 
  <TimeRunning>5129615.178</TimeRunning> 
  <ConnectionsLimit>0</ConnectionsLimit> 
  <ConnectionsCurrent>67</ConnectionsCurrent> 
  <ConnectionsTotal>1424182</ConnectionsTotal> 
  <ConnectionsTotalAccepted>1385091</ConnectionsTotalAccepted> 
  <ConnectionsTotalRejected>39091</ConnectionsTotalRejected> 
  <MessagesInBytesRate>410455.0</MessagesInBytesRate> 
  <MessagesOutBytesRate>540146.0</MessagesOutBytesRate> 
- <Application>
  <Name>TestApp</Name> 
  <Status>loaded</Status> 
  <TimeRunning>411642.953</TimeRunning> 
  <ConnectionsCurrent>11</ConnectionsCurrent> 
  <ConnectionsTotal>43777</ConnectionsTotal> 
  <ConnectionsTotalAccepted>43135</ConnectionsTotalAccepted> 
  <ConnectionsTotalRejected>642</ConnectionsTotalRejected> 
  <MessagesInBytesRate>27876.0</MessagesInBytesRate> 
  <MessagesOutBytesRate>175053.0</MessagesOutBytesRate>
  • 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-06-15T11:39:42+00:00Added an answer on June 15, 2026 at 11:39 am

    The compiler is complaining about this part

    from x in item.Descendants("Application")
    

    inside your Where clause. You should change it so that

    • there is a select clause at the end, and
    • it makes up an expression that evaluates to true for item objects that you would like to keep.

    Here is my best guess at what you are trying to do (EDIT : attempt number two)

    var objApps = from item in xDoc.Descendants("VHost").Descendants("Application") 
                  select new clsApplication {
                      ConnectionsTotal = item.Element("ConnectionsTotal").Value
                  };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll be candid about this; it is a homework assignment, but can someone guide
Can someone guide me on the best practice for this situation; I have a
Can someone guide me towards some good opensource project management tools? I need it
Can someone tell me, where to find a detailed guide, how to build the
I need someone to lead/guide me where have I code wrongly because I can't
Can someone please tell me what this means: 07-04 09:54:38.048: I/DetailActivity(15496): Title that is
Can someone tell me how to modify this regex to allow periods in a
Can someone guide me on a possible solution? I don't want to use /bin/cp
Can someone guide me how to save an OLE embedded object (Object Type ->
Can someone guide me along with the bicubic interpolation math as described on wikipedia

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.