I have a column in my datatable which is of DateTime Type. I only want the DatePart, hence when I use the ToShortDateTimeString it converts to short date but of string type. Hence when i reassign the string to the column of the datatable it again appends 12:00:00 to it. I cannot change the column type in my datatable. Is there any way to convert DateTime to ShortDateTime directly without converting to string?????
Share
You can use the
.Dateproperty, like this:If you wanted to format on display, e.g. in a GridView, you can add the format to your column using the
DataFormatStringproperty, like this: