Hi Friends,
I need a help to solve this issue:
Below is my Code:
Dim Time As DateTime = DateTime.ParseExact(Value, "dd-MMM-yyyy", CultureInfo.InvariantCulture)
Dim TimeString As String = Time.ToString("dd-MMM-yyyy")
TextBox.Text = TimeString
Value is the String which is having Value as : '08/12/2012' i.e in 'dd/MM/yyyy'.
And my actual need is to convert this data from DB to '08-DEC-2012' i.e in 'dd-MMM-yyyy' format.
But i am struck to get that due to the following error :
String was not recognized as a valid DateTime. ---> System.FormatException: String was not recognized as a valid DateTime.
Please help me to sort this problem.
Thanks in advance !!!