Solved

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

Posted on 2008-10-31
1
302 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
Comment Utility
Try the Date.ParseExact method....

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

Wayne
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now