Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > DataFormatString Date

Reply
Thread Tools

DataFormatString Date

 
 
Nico VanHaaster
Guest
Posts: n/a
 
      10-04-2006
Hey guys,

This should be really simple however i just can't figure it out. I am
using a GridView to display hours results from a database. Now the date
field in the database is formated as a short date (Access) mm/dd/yyyy
however when ever it is displayed back on the page it is displayed as
MM/dd/yyyy hh:mm:ss

Now this is my code for the boundfield. Any Quick Pointers?
<asp:BoundField DataField="Date" DataFormatString="{0:MM/dd/yyyy}"
HeaderText="Date"
SortExpression="Date">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>

Thanks In Advance

Nico

 
Reply With Quote
 
 
 
 
ReyN
Guest
Posts: n/a
 
      10-04-2006

hello nico

you have to add

htmlencode=false

http://authors.aspalliance.com/aspxt...tmlEncode.aspx

 
Reply With Quote
 
 
 
 
Nico VanHaaster
Guest
Posts: n/a
 
      10-05-2006
Of course..

Thanks for Noticing that.

Cheers Nico

 
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
dataformatstring template column why is getting a short date so ha cindy ASP .Net Datagrid Control 1 04-20-2006 03:30 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments