Results 1 to 5 of 5

Thread: [RESOLVED] Get the Element with highest value

Threaded View

  1. #1

    Thread Starter
    Addicted Member skea's Avatar
    Join Date
    Mar 2006
    Posts
    187

    Resolved [RESOLVED] Get the Element with highest value

    Linq2Xml:
    [Edited]
    I would like to get the count of elements where candidate has maximum/highest . I need some help.

    Code:
    <Pronvice_Data>
            <Pronvice>PronviceA</Pronvice>
            <Registered_Voters>115852</Registered_Voters>
            <Sam_Kea>100</Sam_Kea>
            <Jeje>500</Jeje>
            <John_Doe>400</John_Doe>
            </Pronvice_Data>
            
          <Pronvice_Data>
          <Pronvice>PronviceA</Pronvice>
        <Registered_Voters>25852</Registered_Voters>
        <Sam_Kea>200</Sam_Kea>
        <Jeje>100</Jeje>
        <John_Doe>300</John_Doe>
          </Pronvice_Data>
          
          <Pronvice_Data>
          <Pronvice>PronviceC</Pronvice>
          <Registered_Voters>317684</Registered_Voters>
          <Sam_Kea>1000</Sam_Kea>
          <Jeje>1200</Jeje>
          <John_Doe>190</John_Doe>
          </Pronvice_Data>
    Expected Result:

    Code:
    Candidate | Won In
    Jeje            2
    John_Doe    1
    Sam_Kea     0
    Last edited by skea; Mar 7th, 2010 at 07:56 AM. Reason: Edited
    Using:VS 2008 Team System :: SQL Server 2005 Standard Edition.
    ----------------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width