Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Un-wanted format

Reply
Thread Tools

Un-wanted format

 
 
J. Active
Guest
Posts: n/a
 
      03-31-2007
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 !
****************
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      04-15-2007
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}") %>


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net





"J. Active" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 !
> ****************


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Money Format + Decimal Place Format shannon Java 1 02-02-2006 03:47 PM
Money Format + Decimal Place Format shannon Java 0 02-01-2006 10:02 PM
need code to convert float format to internal java float format which is kept in 4 bytes integer Andy Java 7 05-10-2004 09:26 PM
NTFS quick format and normal format Guan Foo Wah MCSE 2 05-08-2004 11:35 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM



Advertisments