I wanted to convert column value from date time to string

Can anyone tell me how to convert date time column into string type in datatable using LINQ query?

Thanks in advance

@Nisha_K21

Hi @Nisha_K21

dt.AsEnumerable().ToList().ForEach(Sub(row) row("DateColumn") = Convert.ToDateTime(row("DateColumn")).ToString("dd-MM-yyyy"))

Regards,

Is there any other way to do this? I didn’t find useful this.

@Nisha_K21

Can you try with Format Cells activity

Regards,

Hi @lrtetala , I didn’t get could you please elaborate

@Nisha_K21

Create a new column of string tupe and then use assign

Dt.Columns("New col").Expression = Convert([OldColumnName],System.String)

Cheers