Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
VB.NET Convert DateTime to string inside repeater
Old 12-11-2004, 12:25 PM VB.NET Convert DateTime to string inside repeater
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
Hi All,

I have a function in my DLL called GetNewsArticles which returns a DataSet. I then use this dataset to populate a repeater control. The problem I'm having is that it displays the date as a full date, with the time as well, which I don't want.

In other parts of the code, where I'm only returning one row from the database, I've used the .ToString("dd/MM/yyyy") method and it works fine, however this doesn't seem to work between the <%# %> bits of the repeater...

Any ideas?
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
 
Register now for full access!
Old 12-12-2004, 12:58 AM
WebcyteDesign's Avatar
Registered User

Posts: 159
Location: Hamilton
Trades: 0
have you tried datetime.ToShortDateString.
WebcyteDesign is offline
Reply With Quote
View Public Profile Visit WebcyteDesign's homepage!
 
Old 12-12-2004, 02:43 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
I didn't expect it to, but
<%# DataBinder.Eval(Container.DataItem, "nws_Date").ToShortDateString %>
worked.
<%# DataBinder.Eval(Container.DataItem, "nws_Date").ToString("dd/MM/yyyy") %>
didn't work.

Thanks.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 12-13-2004, 12:07 AM
WebcyteDesign's Avatar
Registered User

Posts: 159
Location: Hamilton
Trades: 0
Any time.
WebcyteDesign is offline
Reply With Quote
View Public Profile Visit WebcyteDesign's homepage!
 
Reply     « Reply to VB.NET Convert DateTime to string inside repeater
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13049 seconds with 12 queries