Hi everyone,
i have combobox which i list of all 12 months.
I display there name of each month.
But for the code i must convert it to number.
When i try to convert it i get error "String was not recognized as valid DateTime".
Here is the code:
//Month name , for example January
string month = comboBox3.Text.Trim();
//Month number according to selected month in combobox3
int month1 = DateTime.ParseExact(month, "MMM",CultureInfo.CreateSpecificCulture("en-GB")).Month;
Can you help me?
Thank you.
Rajanikant HawaldarPosted May 2, 2020, 11:06 AM
Željko PerićPosted May 2, 2020, 12:16 PM
Rajanikant HawaldarPosted May 2, 2020, 11:13 AM
Jignesh KumarPosted May 2, 2020, 10:52 AM
Vuk StanojevicPosted May 2, 2020, 10:47 AM
@Rajanikant Hawaldar, unfortunatelly it didn't solve my problem, error is the same.
Rajanikant HawaldarPosted May 2, 2020, 9:48 AM