linqtosql order by string with numbers

Hi ,
Thanks !
Am using linqtosql and C#.

Have attached the screen shot of the datasource .
I need to order the list by name,  (Screen shot is attached ) but name is alphanumeric string. Each record under name starts with section ??:  i.e. Section 12 : test
                          Section 11: test
                          Section 00: test


I need to order by name by sort through numbers which you see  within the string


Expected output:
=============
{Folderkey=27, Name="Section1:Underwriting"}
{Folderkey=25, Name="Section2:Third-Parth Reports"}
{Folderkey=4, Name="Section3:Borrower"}

code:
public ActionResult FolderRearrangePopupLoad(Guid taskInstanceId, string Model)
        {
            var nums = "0123456789".ToCharArray();//skumar:20180104 for task#
            var reordermodel = new FileReorderModel { TaskInstanceId = taskInstanceId };

            var FileList = (from filelist in taskManager.GetAllTaskFileByTaskInstanceId(taskInstanceId)
                            select new
                            {
                                filelist.TaskFileId,
                                Name = filelist.FileName

                            });

            ViewBag.FileList = FileList;


            var folderlist = (from folders in appProcessManager.GetFolderbyViewId(1)
                              orderby folders.FolderName.LastIndexOfAny(nums)
                              orderby folders.FolderName
                              select new
                              {
                                  folders.FolderKey,
                                  Name = folders.FolderName

                              });
            ViewBag.FromFolder = new SelectList(folderlist, "FolderKey", "Name");

Open in new window


Kind regards,
Suresh
Folder-list.PNG
poojasureshkumarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

poojasureshkumarAuthor Commented:
Hi,
Please find the screen shot. don't know why 00 is coming after 9 instead that appears at the top.

Kind regards,
Pooja
test1.PNG
0
poojasureshkumarAuthor Commented:
I got the solution. I would like to close the question
Please let me know if i need to improve in asking questions or what should i add on top on original question to make it more clear. Just curious why i am not getting any response for several questions.
0
louisfrCommented:
I cannot speak for others, but in my case, I didn't answer because you asked the question at the end of my workday yesterday and it's now the start of my next workday.

Could you post your solution ? It can help other people trying to do the same thing.
0
poojasureshkumarAuthor Commented:
hi LVL 12,
Please find the solution from this link
https://stackoverflow.com/questions/30987026/orderby-containing-numbers-and-letters

Kind regards,
Pooja
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.