ListBox problem

Discussion in 'ASP .Net' started by thebison, Apr 8, 2006.

  1. thebison

    thebison Guest

    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
    thebison, Apr 8, 2006
    #1
    1. Advertising

  2. thebison

    VickZaro Guest

    variable.tostring("MM/dd/yyyy")

    "thebison" <> wrote in message
    news:...
    > 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
    >
    VickZaro, Apr 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blenderdude
    Replies:
    0
    Views:
    822
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    393
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    867
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,313
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,635
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page