Linq orderby ascending with 0 last (as in 1, 2, 3, 0)

Hello,
Can anyone suggest a way to modify this linq query such that the result returned is sorted ascending with 0 last (as in 1, 2, 3, 0)?
            var _players = from p in db.Players
                           where p.ChampionshipId == _ChampId
orderby p.SortOrder != 0 ascending, p.SortOrder
                           select new { p.PlayerId, p.FirstName, p.MiddleName, p.LastName,
                                        p.Country, p.Position,
p.Rank, p.SortOrder };
Thanks in advance
Andrew Fetchko

var res = nums.OrderBy(x => x == 0).ThenBy(x => x);// in your examplevar result = db.Players.Where(x=>x.ChampionshipId  = _ChampId).Select(p=>new
p.PlayerId, p.FirstName, p.MiddleName, p.LastName, 
    p.Country, p.Position, p.Rank, p.SortOrder 
}).OrderBy(p=>p.SortOrder ==0).ThenBy(x => x.SortOrder );

Similar Messages

  • I just recently purchased 3 songs from itunes not knowing that I had no money on my debit card (visa) left. My iphone wont let me update my apps and says that there was a billing problem with my last purchase. I dont know what I am supposed to do!

    I just recently purchased 3 songs from itunes not knowing that I had no money on my debit card (visa) left. My iphone wont let me update my apps and says that there was a billing problem with my last purchase. I dont know what I am supposed to do! I dont understand why it worked in the first place when it wasn't supposed to!

    There seems to be a billing problem with the iTS.  I've been trying to make purchases today (Dec 9th) too and it reports either the iTS can not process payments or it says my card was declined. I even changed the payment method to Paypal (which is never declined) and still no go.
    I don't think it is "you" but a problem at Apple.  Some popular new apps were released recently like Logic Pro and perhaps they're getting bombarded as they did when Lion was released.
    Wait a few hours and then try again.

  • I recently purchased a book and according to my bank account the payment went through buy now when I try to download anything iTunes says there was a problem with my last purchase and won't let me download how do I fix this please?? Do I have to pay again

    I Recently purchased a book from iTunes and according to my bank account the payment was successfull but now when I try to sownload anything it says there was a payment issue with my last purchase! How do I fix this? Do I have to pay again??

    Contact the store support staff at: http://www.apple.com/emea/support/itunes/contact.html for help.

  • I am using my Ipad on a remote craftshow site and am having problems with battery lasting 8 hrs. Can I use a 12v rv battery to recharge it or atleast maintain the charg over longer periods of time? I have a dc adapter. thanks

    I am using my Ipad on a remote craftshow site and am having problems with battery lasting 8 hrs. Can I use a 12v rv battery to recharge it or at least maintain the charge over longer periods of time? I have a dc adapter. thanks

    You should be able to use the battery if you get a car type charger which recharges mobile devices.
    The full size iPads use a 10-12W charger, whereas the mini uses a 5W charger. Many car chargers only supply 5W. But at 5W, the car charger should give you some extra time on your iPad. It would be best to use a 10-12W car charger.
     Cheers, Tom

  • How do I stop Firefox from opening with the last site I was on when I closed instead of using my home page?

    whenever I open firefox after closing it down, it always opens with the last page I was on. I have the settings to point to a specific homepage and have it set to always open on the homepage, but it doesn't.

    I am having a similar problem, I'm using "Show my home page" on start-up but firefox decides to always open to the last page visited regardless. I also generally close Firefox using the red X or with alt+f4. This problem is especially annoying when the last page 'visited' is an annoying pop-up ad that wasn't been caught by the pop-up blocker.

  • Lightroom 4 crashes when trying to open the slideshow module. I spent over three hours with both Adobe and Apple tech support and we know it is a permission issue but have not been able to get it solved.  It started with the last upgrade to 10.8

    Lightroom 4 crashes when trying to open the slideshow module. I spent over three hours with both Adobe and Apple tech support and we know it is a permission issue but have not been able to get it solved.  It started with the last upgrade to 10.8

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • How can i delete the new feature "get in contact with your favourite persons"?? When u press the "home" button twice, theres a list on top of the ipad with the last persons youve been in contact with. How do i delete that, or some of them ;-)

    How can i delete the new feature "get in contact with your favourite persons"?? When u press the "home" button twice, theres a list on top of the ipad with the last persons youve been in contact with. How do i delete that, or some of them ;-) Sorry for the danish  

    You can turn that feature off in Settings>Mail, contacts, calendars>Contacts>Show in App Switcher>Recents>Off.

  • I get a error message "To charge faster, use the cable and device that were provided with this phone" when charging my Samsung Galaxy note 3. I took it to a store last week and they said it has something to do with the last software update.  They tried ch

    I get a error message "To charge faster, use the cable and device that were provided with this phone" when charging my Samsung Galaxy note 3. I took it to a store last week and they said it has something to do with the last software update.  They tried charging it at the store and got the same message. I was given another phone, I still get the same error with the new phone.

    Wowuor, 
    Thank you so much for reaching to us today. I want to make sure that we get the device charging the correct way. There is no physical or liquid damage to the phone or to the power cord correct? Did this error just start to appear as of last week? Please keep us posted. 
    KevinR_VZW
    Follow us on Twitter @VZWSupport

  • Is it possible to create a variable in bex with the last work day?

    Hi Gurus
    Is it possible to create a variable in bex with the last work day?
    Actually end-user every day open queries,
        - Put in selection date day - 1 or
        - put last Friday if the day is Monday or
        - put last Thursday if the day is Monday and Friday is holiday (in a calendar for example 25 the December).
    Please do the needful. It is urgent
    Thanks in advance
    Raj

    Try this logic in a customer exit:
    DATA:  l_s_range TYPE rsr_s_rangesid.
    DATA:  X_PERIOD LIKE T009B-POPER,
               X_YEAR   LIKE T009B-BDATJ.
      CASE I_VNAM.
      WHEN 'ZPREVWORKDAY'.
        DATA: l_DayOfWeek(1) TYPE C,
              l_act_date     TYPE d,
              l_prev_date    TYPE d.
        l_act_date = sy-datum.
        CALL FUNCTION  'DATE_COMPUTE_DAY'
             EXPORTING DATE = l_act_date
             IMPORTING DAY  = l_DayOfWeek.
        CASE l_DayOfWeek.
          WHEN '1'.
            l_prev_date = l_act_date - 3.
          WHEN '2'.
            l_prev_date = l_act_date - 1.
          WHEN '3'.
            l_prev_date = l_act_date - 1.
          WHEN '4'.
            l_prev_date = l_act_date - 1.
          WHEN '5'.
            l_prev_date = l_act_date - 1.
          WHEN '6'.
            l_prev_date = l_act_date - 1.
          WHEN '7'.
            l_prev_date = l_act_date - 2.
        ENDCASE.
        l_s_range-low  = l_prev_date.
        APPEND l_s_range TO e_t_range.
    ENDCASE.
    Edited by: Tyler Blouse on Feb 13, 2008 8:28 PM

  • Itunes locks up my computer every time I try to start it.  This has happened with the last few updates so I have not used it.

    itunes locks up my computer every time I try to start it.  This has happened with the last few updates so I have not used it.

    Hello oldsurfer250,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning iTunes for Windows issues:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717http://support.apple.com/kb/ts1717
    If iTunes for Windows Vista or Windows 7 won't open, stops responding, or unexpectedly quits, try using the steps below. You may want to print this document before following these steps.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • I am having a lot of trouble downloading itunes.My latest error message is that MediaToolbox.dll is missing. I have been trying to fix this for three days now .And it all started with the last update .Can anyone help?

    I am having a lot of trouble downloading itunes.My latest error message is that MediaToolbox.dll is missing. I have been trying to fix this for three days now .And it all started with the last update .Can anyone help?

    Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
    Let's try something relatively simple first. Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "Apple Application Support" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair".
    If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post. (If you've got XP, although the procedure is for Vista and 7, just read "Computer" as "My Computer", read "Uninstall a program control panel" as "Add or Remove programs control panel" and assume the system is 32-bit, and you'll be doing the right things.)
    Re: I recently updated to vista service pack 2 and I updated to itunes 10.2.1 and ever

  • Overwrite mapping in design repository with the last one deployed

    Hi
    We have a Single Design Environment with 2 runtime environnment (Dev, Prod). When I log in the Dev Control Center, I see there is a mapping "changed". It has been changed by an employee who don't work here anymore and I have no clue what have been changed.
    There is no specific request or obvious reason for that change, and since it's a huge and conplex mapping, I would like to overwrite (or "rollback") the mapping in the design environnment with the last one deployed in Production.
    But I don't know how or if it's possible..! At least if I could compare the 2 version, I could tell if the change is good or not.
    To me, it's a showstopper for incoming modifications..
    There is no Snapshot and i'm using OWB 10gr2 since 1 month now, so all of these is new to me.
    I really need help on this one...!
    Thanks!

    one onerous way to do this is
    take the mdl exports of the mapping from both envs. Try opening them in an xml/html text editor(notepad++ for eg)
    If they look like they are encrypted, try renaming the .mdl file to .zip( I can do this in 11g and what this gives me is a .xml file and a .mdx file which can be viewed in an xml editor)
    You can then possibly do a text comparison to find if anything is obviously different.
    Another good option is something our friend Oleg developed.
    http://owbeg.blogspot.co.uk/2012/05/release-005-of-mapreconstruct-script.html
    This script extracts the mapping as an OMB script. You can then compare both mapping tcl outputs.

  • I have a problem, i bought lion but when i want to install he said me i need to "download osx lion server" i'm running with the last lion beta. how to update please?

    i have a problem, i bought lion but when i want to install he said me i need to "download osx lion server" i'm running with the last lion beta. how to update please?
    ps: sorry for my english :S

    You apparently are using a version of OS X you did not purchase using your Apple ID. Although you can download Mavericks you cannot install it over your current system. You must repartition your hard drive, then reinstall the version of OS X originally installed when it came new from the factory. That would be on the installer discs that should have come with the computer. If the computer did not come with discs from the factory but OS X was pre-installed (Lion or Mountain Lion) then you can perform an Internet Recovery:
    Install Mavericks, Lion/Mountain Lion Using Internet Recovery
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Internet Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.
    Partition and Format the hard drive:
    1. Select Disk Utility from the main menu and click on the Continue button.
    2. After DU loads select your external hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed. Quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion. Mavericks: Select Reinstall Lion/Mountain Lion, Mavericks and click on the Install button. Be sure to select the correct drive to use if you have more than one.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • My iPod says there's a problem with my last purchase and every time I try to look at my history to clear the problem it says there no connection to ITunes

    When I log into my acc it ammediatly says there's a problem with my last purchase and to go to my purchase history to clear it.  When I hit continue its suppose to take me to the history but it just loads then says cannot connect

    the itunes says that it knows that there isan ipod there, but it doesnt recognize it. I have reset the ipod, restarted my computer, and reinstalled itunes.
    Doublechecking. Have you tried a complete uninstall of both iTunes and all the other related software components (Apple Mobile Device Support, Apple Application Support, etc ...) and then a reinstall? If not, try the instructions from the following document:
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8

  • Im trying to find my iPhone via iCloud but i does not show a map with its last know location. It only shows the menu options. My iPad and Mac show up but the map of my iPhone does not.

    Im trying to find my iPhone via iCloud but i does not show a map with its last know location. It only shows the menu options. My iPad and Mac show up but the map of my iPhone does not. Can anyone help?

    If your phone is turned off or not connected to the Internet, you will be unable to locate it. Last known location is only stored for 24 hours.

Maybe you are looking for

  • Unable to configure express via airport admin utility

    After much faffing around I finally got my airport express to connect to my existing network and even got the little speaker button to show up in itunes (hooorah) but then it asked me if I wanted to update the firmware so I said yes and then it all w

  • HT201250 Can I back up multiple volumes using Time Machine on Snow Leopard?

    I have a fault with my time machine software where it is no longer able to perform incremental back ups of the volumes (partitions) I have created on my internal hard drive - every attempt results in a full back up. However incremental back up of the

  • Photoshop cc 2014 freezes after start

    Mac Book pro retina 2014, osx 10.9.5, creative cloud for team; 1) Launch Photoshop cc 2014 2) Photoshop FREEZES (can't open or work or save images) 3) "Applicazione non risponde" 4) Creating a new account on mac; Photoshop works in the new account; 5

  • Data Blocks and the Elapsed Time

    Hi, I have created 3 tables with one column only. As an example Table 1 below: SQL> create table T8k( x char(2000)); So 3 tables are created in this way i.e. T8k,T16K and T4K T8 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production

  • Export iPhoto slideshow to a DVD, but get message "OS Status Error -9459".  What does this mean?

    I have created a slideshow (with music) in iPhoto, and each time that I try to export the slideshow, iPhoto stops the process and gives me the error message "OS Status Error -9459".  What does this mean?