?
Solved

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

Posted on 2008-10-31
1
Medium Priority
?
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 80 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

762 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