Changing data table column from datetime to string

Hi,

Please, can someone help me with changing datatype of column in datatable.

I got data table from database, and I need to change Date column from datetime to string format, because I need to put inside Date column date in format ddMMyyyy. How can I do it?

Thanks!

Use convert([columnname], ‘System.String’) in the select statement while specifying the column

1 Like

Try using the below

Date.ParseExact(“dd/mm/yyyy”,strDate.ToString.Trim,System.Globalization.CultureInfo.InvariantCulture).ToString(“mm/dd/yyyy”)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.