Stef_99
(Mary)
March 21, 2024, 6:15am
1
I use Append range workbook but show eroor as below.
dt_result.DefaultView.ToTable(False,dt_result.Columns.Cast(Of DataColumn).Take(27).Select(Function(dc) dc.ColumnName).ToArray()).AsEnumerable.OrderBy(Function(r) CDate(r("Planned Start"))).CopyToDataTable
Please guide me for solve it.
Thank you.
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:19am
2
Hi @Stef_99
Try the below one,
dt_result.DefaultView.ToTable(False,dt_result.Columns.Cast(Of DataColumn).Take(27).Select(Function(dc) dc.ColumnName).ToArray()).AsEnumerable.OrderBy(Function(r) (CDate(r("Planned Start"))).toString).CopyToDataTable
Hope it helps!!
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:24am
4
Could you share your input data… @Stef_99
In the LINQ Query this part CDate(r(“Planned Start”)) only effecting the append range workbook.
Why you want to change the Values in Planned Start column from String to date. If you give me the more explanation about your query. Then we will try to sort your issue.
Hope you understand!!
Stef_99
(Mary)
March 21, 2024, 6:30am
5
@mkankatala
I want to copy column from input file column A-AA and sort Planned Start from old to new ----> append another file
Example input as attached.
input.xlsx (8.4 KB)
mkankatala
(Mahesh Kankatala)
March 21, 2024, 6:35am
6
Based on your input the expression couldn’t matched what is your requirement… @Stef_99
dt_result.DefaultView.ToTable(False,dt_result.Columns.Cast(Of DataColumn).Take(27).Select(Function(dc) dc.ColumnName).ToArray()).AsEnumerable.OrderBy(Function(r) r("Planned Start")).CopyToDataTable
Do you want to change the format the values of Planned Start Column.
Could you be more specific…?
1 Like
system
(system)
Closed
March 24, 2024, 6:35am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.