Un-wanted format

J

J. Active

Hi All;

I am developing a small ASP.NET web site using VS2003, I have a problem when
displaying date information. There is a table made in access 2003 call
“coursesâ€, and I want a data grid component on one of the pages to be
populated with this table. Every thing going very fine except that the column
“Starting Date†in the data grid shows date with a time (for example 1/3/2007
08:00:00 AM) the bothering part is “12:00:00 AM†how could I remove it and
ban it from appearing only as (1/3/2007) with no time. Despite that there is
no appearance of (08:00:00 AM) in the data base column. I don’t know why
ASP.NET attach it to the original date !!

Please help !



--


****************
Nothing at all in this life is perfect. Just live your life a day by day !
****************
 
T

Teemu Keiski

Hi,

you need to user string formatting For example if you have a BoundColumn,
set for example DataFormatString="{0:MM/dd/yyyy}" into it. If you use
DataBinder.Eval, give format string as third parameter

<%#DataBinder.Eval(Container.DataItem,"Starting Date","{0:MM/dd/yyyy}") %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top