I got a date field in the DataTable. I tried to reformat it with String.Format method so the data appears as "6/13/2006" instead of "6/13/2006 12:00:00 AM" in a bound column in a datagrid. Here are the code to change the data in the DataTable before it is bound to a DataGrid.
The application is built without any error. However, the page still shows "6/13/2006 12:00:00 AM" format.
In the debug mode, I got the following message in the Immediate Window.
However, when I started another visual studio and create a console application and stoped in the debug mode, I got the following in the Immediate Window.
Frankly, I am totally lost.
Any suggestions?
Thanks in advance.
Seaport
Code:
row.BeginEdit()
row.Item("ActivityDate") = String.Format("{0:d}", row.Item("ActivityDate"))
row.EndEdit()
The application is built without any error. However, the page still shows "6/13/2006 12:00:00 AM" format.
In the debug mode, I got the following message in the Immediate Window.
Code:
?String.Format("{0:d}", row.Item("ActivityDate"))
The parameter is incorrect.
?string.format("{0:d}",datetime.now())
The parameter is incorrect.
However, when I started another visual studio and create a console application and stoped in the debug mode, I got the following in the Immediate Window.
Code:
?string.format("{0:d}",datetime.now())
"6/20/2006"
Frankly, I am totally lost.
Any suggestions?
Thanks in advance.
Seaport