Hi All,
below query is not working for me.
i have excel file which has some columns and based on one column(Ageing) i want to sort the data in Ascendinh or Descending order.
(From row In dt_list.AsEnumerable
Order By Ageing(row.Item(2))Ascending Select row).copyToDataTable
Thanks
Hi @RAKESH_KUMAR_Tiwari ,
Try the below format:
InputDt = (InputDt.AsEnumerable.OrderByDescending(Function(x) x(“Ageing”).ToString)).CopyToDataTable
Regards,
2 Likes
Anil_G
(Anil Gorthi)
April 6, 2023, 4:45pm
3
@RAKESH_KUMAR_Tiwari
Please try this
Dt.AsEnumerable.OrderBy(function(x) Cdbl(x("Aging").ToString)).CopyToDataTable
Assuming all rows have data and they are numbers
Hope this helps
Cheers
1 Like
Anil_G
(Anil Gorthi)
April 6, 2023, 5:11pm
6
@RAKESH_KUMAR_Tiwari
Check the assembly reference or close …rename project.json and reopen
Cheers
i didn’t get it.
Please explain me step by step from start to end, what i need to do it.
You can fix it by adding the Assembly Reference manually in your xaml file: question- how to add it manually?
Simply open the file in Notepad and create new line with this String: question - which notepad file it is refering here
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
Then reopen your project and the error should be gone.
Please be careful while doing so and always keep a backup.
Anil_G
(Anil Gorthi)
April 6, 2023, 5:26pm
8
@RAKESH_KUMAR_Tiwari
First close your project…and rename the project.json file…then reopen the project and check if the issue is fixed
If not then open your xaml in notepad ++ and then just add the reference …that is highlighted in the picture and then re open…
For safety keep the file backedup
Cheers
but, i donot have option to rename the project.json file
Anil_G
(Anil Gorthi)
April 6, 2023, 5:40pm
10
@RAKESH_KUMAR_Tiwari
Anil_G:
First close your project
First step is to close ypur project…remaining steps are to be done using your file explorer not UiPath
Or just create a new project mostly that should work in the new peoject also. Issue is a package reference went missing in the references
Cheers
1 Like
Anil_G
(Anil Gorthi)
April 6, 2023, 5:46pm
12
@RAKESH_KUMAR_Tiwari
After closing …open the folder containing your project using a file explorer not the UiPath and the project menu that you get(no for this)
From the file explorer right click and rename
Cheers
Hi @Anil_G
i went to project folder through file explorer and rename the project.json again with same name, then i changed the Framework name also, but still there is error, but also i can see that after changing the framework work , it craeted another Project file.
project.json i renamed and then changed the framework name, after changing i can see it is created another project which of json type, img for reference.
Anil_G
(Anil Gorthi)
April 7, 2023, 7:53am
14
@RAKESH_KUMAR_Tiwari
The purpose of changing the name is to let it create a new file and if possible it would automatically add references…as that did not happen
Now…open your xaml which is faulting in a notepad or notepad++ and add the assembly reference line for system.data.DataExtensions
Cheers
1 Like
Hi @Anil_G ,
i can see that error has gone now , but it is not sorted the data in any order either ascending or descending.
After function in x variable do i need to mention Ascending or descending?
Anil_G
(Anil Gorthi)
April 7, 2023, 8:06am
16
@RAKESH_KUMAR_Tiwari
Ideally it would…can you confirm if the data in aeging is of type number?
And are you checking the right output table?
Cheers
sorry, my bad i was checking different dt table, now it giving me the output as Ascending order.
but what will be the query to fetch in Descending order? i want 40, 26, 18, 5
Anil_G
(Anil Gorthi)
April 7, 2023, 8:15am
18
@RAKESH_KUMAR_Tiwari
Instead of Ordeby
use OrderByDescending
Cheers
1 Like
system
(system)
Closed
April 10, 2023, 8:17am
20
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.