Results 1 to 4 of 4

Thread: Formatting dates in a bound control (textbox and datagrid)

  1. #1

    Thread Starter
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43

    Angry Formatting dates in a bound control (textbox and datagrid)

    OK ... I have looked just about everywhere to find out how to do this.

    In VB6 a textbox had a property to set the format of a date when it was bound to a DB. In VB.NET our fearless leaders in Redmond, WA removed that property. I am obviously just slightly frustrated with my inability to figure out how to do it now.

    More specifics:
    * textbox and datagrid bound to a SQL 2000 DB via a named dataset
    * the DB field is a datetime
    * by default it shows both a date and time
    * only the date is in the DB (the time it shows is 12:00 am for all records)



    please help me ... If I were not already bald I'd be at the point to pull all my hair out.

    Thanks

  2. #2
    New Member
    Join Date
    Nov 2002
    Posts
    4

    formatting dates in bound control

    Use format {0:d} in the databinding format section

  3. #3

    Thread Starter
    Member EagleEye's Avatar
    Join Date
    May 2002
    Location
    South Carolina, USA
    Posts
    43

    Question

    mcharaia,

    "formatting dates in bound control
    Use format {0:d} in the databinding format section"

    I must be lost or you are telling me how to do it in VB6 because I do not see any section in VB.NET under data-binding that even resembles format.

    If it is there could you detail the instructions a little more?

    Thanks


  4. #4
    New Member
    Join Date
    Nov 2002
    Posts
    4

    formatting dates in bound control

    Excuse me if I have confused you even more. I am new to VB.net. I am using oledbdataadapter for Oracle database, then I am binding my dataset fields to textbox as well as datagrid.
    From datagrid’s ‘property binder’, I am able to format each column entering the expression under ‘data formatting expression’.
    Similarly for ‘textbox’, I can do the same under ‘databindings’

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width