جناب sanay_esh با استفاده از این کلاس و توضیحاتی که دادید من تقویم رو فارسی کردم اما یک سوال دارم:
چطور می تونم تاریخ رو در دیتابیس به صورت date ذخیره کنم ؟من کدهای زیر رو نوشتم اما هنگام ذخیره error میده :
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
PersianCalendar pc = new PersianCalendar();
DateTime Date = Calendar1.SelectedDate;
TextBox1.Text =pc.GetYear(Date)+"/"+pc.GetMonth(Date)+"/"+pc.GetDayOfMonth(Date);
d1 = new DateTime(pc.GetYear(Date),pc.GetMonth(Date), pc.GetDayOfMonth(Date) ,pc);
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrin gs["calendarConnectionString1"].ConnectionString);
SqlCommand cmd = new SqlCommand("insert into dates (date) values ('" +d1+ "')",con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Label1.Visible = true;
Label1.Text = "sabt shod";
GridView1.DataBind();
خطایی که میده اینه:
Specified time is not supported in this calendar. It should be between 03/21/0622 00:00:00 (Gregorian date) and 12/31/9999 23:59:59 (Gregorian date), inclusive.
Parameter name: time