PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET ListBox Problem

Reply

ListBox Problem

 
Thread Tools Rate Thread
Old 08-04-2006, 04:07 PM   #1
thebison
Guest
 
Posts: n/a
Default ListBox Problem


Hi all,

I hope someone can help with this relatively simple problem.
I am building a timesheet application using ASP.NET C# with Visual
Studio 2003.As it is only a protoype application, my database has been
made in MSDE.

I've searched all over the web for the answer, but can't quite work it
out. I am filling a list-box with Time Periods consisting of 'Start
Date' and 'Finish Date' from a table, and have concatanated
these into a new field, 'Full Date'. However when I DataBind the
list-box it shows the format as '01/10/06 12:00:00 - 07/10/06
12:00:00'. I do not want the times to show. I know how to format one
column, using the DataTextFormatString property, setting it to {0:d} ,
but I can't work out what it will need to be for my 'Full Date' field.

The actual data expression for 'Full Date' is
StartDate + '-' + FinishDate

And I wish it to show in the ListBox as '01/10/06 - 07/10/06'.
Anyone have any ideas on what I should put into DataTextFormatString to

achieve this, so that the times are not included?


Many Thanks!


Al

  Reply With Quote
Old 10-04-2006, 12:07 AM   #2
thebison
Guest
 
Posts: n/a
Default Re: ListBox Problem

I've solved this now, I needed to add a new column to my DataAdapter

select convert(varchar(20),StartDate, 103) + '-' +
convert(varchar(20),FinishDate, 103) as FullDate from TimePeriods

Thanks

Al

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off