Im creating a project where the a blog can be submitted, the date is stored in the database as dd/mm/yy, however im using LINQ to SQL to get the date as well as other information, the problem comes when i want to display the date in a particular layout (similar to this website: http://highrockmedia.com/tags/css).
below is the code im using to get the data but i want to split the date up into different labels so i can position them where i want. Is this the best option?
using (apiContentDataContext api_GetContent = new apiContentDataContext())
{
var result = from c in api_GetContent.getAllContent()
select new
{
c.content_Date,
c.content_Intro,
c.content_Main,
c.content_Title
};
LVContentHome.DataSource = result;
LVContentHome.DataBind();
but now the date has been retrieved from the database i cannot do anything with it, if i try it result in an error.
The alternative way was to do the following:
<a><%# Eval("content_Date", "{0:dd}")%></a>
<a><%# Eval("content_Date", "{0:MM}")%></a>
<a><%# Eval("content_Date", "{0:yyyy}")%></a>
I don't know if there's a better way to do this? Any help/suggestions would be very helpful.
Regards
BarrieGrant1