Results 1 to 3 of 3

Thread: Running procedures in vb.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    83

    Running procedures in vb.net

    hi:

    im building a vb.net web based application. one of the forms executes a procedure when clicking the button.

    i want teh below procedure to run:

    " Execute Calculate_RL ('31-AUG-2005'); "

    i get the date from the user as 31-8-2005. how do i convert it to the format of ('31-AUG-2005') in vb.net?

    thanks

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

    Re: Running procedures in vb.net

    using the date object and .Parse (which is on most of vb.net types to convert strings to proper types)

    VB Code:
    1. Dim dd as new Date
    2. dd.Parse("31-8-2005")

    that should work.
    then you can manipulate it like a date (subtract days, extract weeks, leap years etc)

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: Running procedures in vb.net

    VB Code:
    1. Dim myDate As Date = Date.Parse("31-8-2005")
    2.         MsgBox(Format(myDate, "dd-MMM-yyyy"))
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

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