Results 1 to 5 of 5

Thread: vb2010. convert string to date

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    6

    vb2010. convert string to date

    hi everyone

    I'm studying visual basic in my course
    and in my book there was this example



    so when I tried to do it , it didn't work
    I did the same thing as written
    but I don't know what is the problem with me

    this is the error message apear to me


    can you help

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

    Re: vb2010. convert string to date

    I can only assume that it has something to do with the system date format on your machine. If you do this:
    vb.net Code:
    1. MessageBox.Show(Date.Now.ToShortDateString())
    what do you see?
    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

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    6

    Re: vb2010. convert string to date

    yaah, it seems that

    what apear is the date of today 05/04/32
    cuz my computer is in hijri calender

    so what I have to do , can I change it?

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

    Re: vb2010. convert string to date

    You need to enter a string that your system can recognise as a date.
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    6

    Re: vb2010. convert string to date

    I change the calendar type and it work now
    thank you

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