The Mother Board

Motherboards.org forums. Free tech support, motherboard ID, and more.
It is currently Sun Sep 23, 2018 12:17 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Aug 09, 2005 1:09 am 
Offline
Initiate
Initiate

Joined: Fri Apr 11, 2003 8:23 am
Posts: 64
Location: Turkey
i'm working on a asp.net page that connects to a access database. in the table from which the page views data from, i have a date type field in short date format. But the asp brings the values with time added. i want to get rid of times, i want only the date to be seen. but when i try

<asp:Label id="Label5" runat="server" Text='<%#
cdate(Container.DataItem("Opening")) %>' />

in my datagrid's itemtemplate, it gives the error:

Cast from type 'DBNull' to type 'Date' is not valid.

note there are empty rows in the Opening field and it's supposed to be so.

tried to use if statement to avoid converting empty rows but couldn't figure how to use conditional expressions between server tags in the body. i don't even know i it's possible.

Waiting for your opinions. thx from now...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 09, 2005 2:42 am 
Offline
Initiate
Initiate

Joined: Fri Apr 11, 2003 8:23 am
Posts: 64
Location: Turkey
databinder.eval(Container.DataItem,"Fieldname", "{0:d}")
does the job. stoopid me


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group