473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Format a Date from a DataBinder.Eval

Hello,

I have a date in a SQL Database and want to use the dateformat tools to
format the output. I am now using the Month, Day, and Year to do it now.

I want to change:

Released Date: <%#Month(DataBinder.Eval(Container.DataItem, "ProdDate"))
& "/" & Day(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" &
Year(DataBinder.Eval(Container.DataItem, "ProdDate")) %><BR><BR>
To:

Released Date: <%#DataBinder.Eval(Container.DataItem,
"ProdDate").ToString("d")%><BR><BR>

But I get an error.

Any help would be great!!!

Thanks for you time and help,

Jack
Nov 18 '05 #1
2 20618
Jack,

I haven't tested this code but it will look something like this:

<%#String.Format("d", DataBinder.Eval(Container.DataItem,
"ProdDate").ToString)%>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"jack" <ja**@mrolinux.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
Hello,

I have a date in a SQL Database and want to use the dateformat tools to
format the output. I am now using the Month, Day, and Year to do it now.

I want to change:

Released Date: <%#Month(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" & Day(DataBinder.Eval(Container.DataItem, "ProdDate")) & "/" &
Year(DataBinder.Eval(Container.DataItem, "ProdDate")) %><BR><BR>
To:

Released Date: <%#DataBinder.Eval(Container.DataItem,
"ProdDate").ToString("d")%><BR><BR>

But I get an error.

Any help would be great!!!

Thanks for you time and help,

Jack

Nov 18 '05 #2
you can use this:

<%# DataBinder.Eval(Container.DataItem, "ProdDate", "{0:d}")%>

that should do the trick

From http://www.developmentnow.com/g/8_20...inder-Eval.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval:...
1
by: A Ratcliffe | last post by:
Although at the moment, I have a couple of large classic ASP projects on the go, when I need to take a break, I'm experimenting with ASP.NET (with both VB.NET and C#). I notice that most...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
1
by: Charlie | last post by:
Hi: Is it possible to apply formatting to above statements which insert field values into HTML when binding to a datasource using Repeater control? For example, I would like to trim trailing...
4
by: darrel | last post by:
I'm binding fileinformation to a repeater and attempting to display the 'lastWriteTime' property as a formatted date. This: <%# DataBinder.Eval(Container.DataItem, "LastWriteTime" %> Gives...
4
by: Wayne Wengert | last post by:
I have an aspx page in which I retrieve data from an SQL Server. At one point I am retrieving a smalldatetime field and I want to display only "mm/dd/yy" but the default seems to be to add the...
2
by: Oleg Ogurok | last post by:
Hi all, I have a DatePicker ASP.NET control that allows users to enter date (e.g. a calendar control). The control has the following property public DateTime Value { get; set; } I've placed...
4
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever...
14
by: WT | last post by:
Hello, I have a usercontrol loaded in a page with a theme. This usercontrol contains columns template with hyperlinks, with skinID. The columns are not displayed, seems thta there is some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.