dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: DateTime.Now.ToShortDateString() ???

  1. #1
    Join Date
    Apr 2004
    Posts
    50

    DateTime.Now.ToShortDateString() ???

    myCommand.Parameters("@Date").Value = DateTime.Now.ToShortDateString()

    Visual Studio tells me: Name 'DateTime' is not declared. Am I missing a namespace? If so, which one?

    Thanks!

  2. #2
    Join Date
    Nov 2005
    Posts
    109
    take the time out. The line should look like this.

    myCommand.Parameters("@Date").Value = Date.Now.ToShortDateString()

    I believe the ToShortDateString() class takes the time out for you. It's been awhile since I did anything with dates. But I do remeber that the line should look like that.

  3. #3
    Join Date
    Apr 2006
    Posts
    2
    DateTime is a struct from System, so if something is missing is the namespace System.
    The rest should work
    myCommand.Parameters("@Date").Value = DateTime.Now.ToShortDateString()

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles