نمایش نتایج 1 تا 2 از 2

نام تاپیک: error: System.StackOverflowException

  1. #1

    error: System.StackOverflowException

    با سلام و تبریک سال نو من در بر نامه خودم با خطای System.StackOverflowException رو بروشدم . زمانی که می خاستم persiandate=value رو مقداد دهی کنم اون در loop بی پایان می افته .و خطای An unhandled exception of type 'System.StackOverflowException' occurred in clinic.model.DLL را می دهد.
    کد بر نامه:



    protected void Button1_Click(object sender, EventArgs e)
    {
    pesiandate objpesiandate = new pesiandate();
    Customer objcustomer = new Customer();
    objcustomer .persiandate= objpesiandate.tody ();
    }
    ..............


    public class persiandate
    }
    public string tody()
    {

    PersianCalendar pc = new PersianCalendar();
    DateTime now = DateTime.Now;
    string year = pc.GetYear(now).ToString();
    string month = pc.GetMonth(now).ToString();
    string day = pc.GetDayOfMonth(now).ToString();
    if (month.Length < 2)
    month = "0" + month;
    if (day.Length < 2)
    day = "0" + day;
    return year+"/" +month+"/" +day ;
    .................

    public class customer
    }
    public string persiandate
    {

    get
    {
    return persiandate;
    }


    set
    {
    persiandate = value;

    }
    {

    {

  2. #2

    نقل قول: error: System.StackOverflowException

    public string persiandate
    {
    get;
    set;
    }

    و یا
    private string _persiandate;
    public string persiandate
    {
    get { return _persiandate; }
    set { _persiandate = value;}
    }

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •