Solved

Conversion from string "10/22/2008" to type 'Date' is not valid.

Posted on 2008-10-31
1
306 Views
Last Modified: 2012-05-05
Hi
In my ASP.NET 2.0 Visual Basic Webstie I try to do

incident.ResolutionDate = tbComDate.Text

where

Public Property ResolutionDate() As DateTime
            Get
                Return _resolutionDate
            End Get
            Set(ByVal Value As DateTime)
                _resolutionDate = Value
            End Set
        End Property

tbComDate.Text is "10/22/2008"
Anyone know how to format is correctly as the date format should be day month year but I'm passing it in as month day year (ie 10/22/2008)

Thanks
AM


 
0
Comment
Question by:amoran
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 20 total points
ID: 22850253
Try the Date.ParseExact method....

    incident.ResolutionDate = Date.ParseExact(tbComDate.Text, "mm/dd/yyyy", My.Computer.Info.InstalledUICulture)

Wayne
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery datatables integration with ASP.NET MVC, bootstrap 3 22
Visual Studios 1 76
How to limit User Input 2 27
VB.Net. Reading xml value 6 29
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question