I\'m importing data from an Excel sheet on to a DataTable using the following code:
OleDbConnection con = new OleDbConnection(\"Provider=Microso
You can use this function to format whatever date format you received to the format you need.
Here is the code:
Public Shared Function ConvertToDate(ByVal dateString As String, ByRef result As DateTime) As Boolean
Try
'Here is the date format you desire to use
Dim supportedFormats() As String = New String() {”dd/MM/yyyy”}
'Now it will be converted to what the machine supports
result = DateTime.ParseExact(dateString, supportedFormats,System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None)
Return True
Catch ex As Exception
Return False
End Try
End Function