Results 1 to 14 of 14

Thread: Using VB 6 functions in .net

Hybrid View

  1. #1
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Using VB 6 functions in .net

    then just simulate the tryparse like this

    VB Code:
    1. Dim dt As Date
    2. Try
    3.   dt = Date.Parse("23 April Watevaaa...")
    4. Catch
    5.   'code for if string was not a valid date
    6. End Try

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    7

    Re: Using VB 6 functions in .net

    Quote Originally Posted by Phill64
    then just simulate the tryparse like this

    VB Code:
    1. Dim dt As Date
    2. Try
    3.   dt = Date.Parse("23 April Watevaaa...")
    4. Catch
    5.   'code for if string was not a valid date
    6. End Try
    That is the problem, date.parse is very slow in .net 1.1 if the value passed is not a date. Try it with a odd string and see how long it takes to return an exception.

    BTW, Date.TryParse in .net 2.0 works great! Now I need to convience my boss to fork out the cash.

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