Click here to Skip to main content
15,906,285 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friend,
In my project two date time pickers are there.In one date time picker i will show month and another one year.Iam using for month format-MMMM and Year Format - YYYY.But in runtime i got this error.Iam using showupdown property also.

My Error is:
Year, Month, and Day parameters describe an un-representable DateTime(Argumentoutofrange exception was unhandled)

Please Solve my Problem.


Thanks & Regards
Posted
Updated 29-Sep-11 19:53pm
v2
Comments
Justin Porteous 29-Sep-11 9:47am    
Please post your code so that we can assist better.

Also, Have you considered using only one date picker?

1 solution

Try:

C#
DateTime date = DateTime.ParseExact( txtDate.Text, "MMMM yyyy", System.Globalization.CultureInfo.CurrentCulture );

//you can interchange the above format to: yyyy MMMM


And by the way, "YYYY" is not a valid format!

Goodluck
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900