Wrox Programmer Forums
C# 2012/5.0 General Discussion Discussions about the C# 2012 language and tool not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2012/5.0 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 3rd, 2013, 04:20 PM
Authorized User
Join Date: Sep 2013
Posts: 18
Thanks: 8
Thanked 1 Time in 1 Post
Default Calendar OutofRange Problem

I have a problem with PersianDateCalendar class and ArgumentOutOfRangEexception... here is my code :

DateTime get = Convert.ToDateTime(TextBox1.Text);
PersianCalendar p = new PersianCalendar();
DateTime set = new DateTime(p.GetYear(get), p.GetMonth(get), p.GetDayOfMonth(get));

for some dates it's working and for some it's not working!!!! for example when I write 7/22/2006 or 5/20/2006 it throw an ArgumentOutOfRangeException... I know what is this Exception and what it means.. but the problem is it's not out of range in real world!!! is it??? Have I done something wrong?? or is it a bug in class?
The exception throw at DateTime set...
what can I do now?
thanks in advance

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar like calendar in AJAX in ASP.NET h@ckerz ASP.NET 2.0 Professional 0 February 19th, 2008 12:56 AM
problem in calendar visibility premnaath ASP.NET 2.0 Professional 1 November 16th, 2007 09:25 AM
Calendar problem in ASP heba ASP.NET 2.0 Professional 1 June 5th, 2007 08:42 AM
Calendar Problem mg1966 Classic ASP Databases 2 February 15th, 2005 11:28 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.