Results 1 to 3 of 3

Thread: separate date character

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    24

    separate date character

    i enter date in textbox in format :26/12/2006
    i just want get the month n year value:
    how to separated it

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: separate date character

    You should use a DateTimePicker, not a TextBox. The you can get a Date object from its Value property, then get the Month and Year properties from that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: separate date character

    If you still insist on using a textbox (which is a very bad idea), you can use either Date.Parse or Date.TryParse (which is more prefered) to parse the string in the textbox to a Date object, then the month from its Month property as JMC said.

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