i have one data table variable and 40 columns and i want to change date format from dd-MM-yyyy to MM/dd/yyyy HH:mm:ss and i need to change this format for only D column and x column so how do this with out using for each row because sometimes row line items goes as 65000 so it takes too much time
Please try this
Dt.AsEnumerable.ToList.ForEach(sub(r) r("ColumnName") = Cdate(r("ColumnName").ToString).ToString("MM/dd/yyyy HH:mm:ss"))
Cheers
im getting error as
@sathish_Kumar6 please check your script seems you right ForDeach instead ForEach
okay sure will check and update
okay sure will check
Dt.AsEnumerable.ToList.ForEach(Sub(r) r(“Sales Invoice Date”) = CDate(r(“Sales Invoice Date”).ToString).ToString(“MM/dd/yyyy HH:mm:ss”)).CopyToDataTableDt.AsEnumerable.ToList.ForEach(Sub(r) r(“Delivery Date”) = CDate(r(“Delivery Date”).ToString).ToString(“MM/dd/yyyy HH:mm:ss”)).CopyToDataTable
Still getting error could u please take a look at this
date format @Anil_G
to change MM/dd/yyyy hh:mm:ss
The expression provided is to be used in invoke code with dt as the in/out parameter
the date format in excel and when we read generally differs…check from locals panel after reading
cheers
i tried but im getting some errors so could you please share xaml if possible or could see error pic and let me know what to do ?
Please give like this
Dt.AsEnumerable.ToList.ForEach(sub(r) r("ColumnName") = Cdate(r("ColumnName").ToString).ToString("MM/dd/yyyy HH:mm:ss"))
cheers
It is taking more than ten minutes and im not getting output so what to do?
Do you mean its stuck there?
Or its taking some time?
Did you assign dt in the invole code arguments?
Cheers
It is taking time or dont know its stuck since it is having large data
In this excel file i want to change it in d column and x column please refer this excel file
Testfile.xlsx (9.7 KB)
i checked and idk where it goes wrng…