Converting Date string to DateTime Format

I have this example and it gives me exception "Conversion from string x to dateTime is invalid"

here is my method to validate Datetime.

Example Date string : "27/03/1985"

Public Function validateDateColumn(ByRef FieldName As String) As Boolean

        If IsDate(FieldName) Then
            Dim actualDate As DateTime = CDate(FieldName)
            Dim DtLicExp As DateTime = CDate(actualDate.ToString("d", Thread.CurrentThread.CurrentCulture))
            FieldName = DtLicExp.ToString("MM/dd/yyyy")
            Return True
        End If
    Catch ex As Exception
        'FieldName &= "Format must be MM/dd/yyyy"
        Return False
    End Try

End Function

any idea to validate this date string formate to datetime.

I want to convert this date "27/03/1985" to datetime.

I'm using with


Have a look at using DateTime.TryParseExact Method or DateTime.ParseExact Method

Need Your Help

Download all the links from any page

c# file-io download

I want to develop an page through which I can specify the URL of any page which contains links of many files & directories. I want to download them all. Similar to DownThemAll plugin of

Custom message for push registry alert j2me

java-me push-notification midlet wtk

When I receive a push notification in my j2me application it shows its built-in message at start, what I want to do is to place my own message say "Do You Want to Launch App?" when a notification of