3
Answers

How to calculated due date betwen two date in ASP.NET Web Form

Hi Guys,,, I'm try to calculated due date betwen two date but I'm can't solve this trouble. I'm found the refrence code in VB and then I'm try to translate that code to C#. Anny help could be appriciate.

this isi code to calculated due date betwen two date in VB.NET

'find maturities based on installments to ??? 
DueDate.Text = DateAdd(DateInterval.Month, Val(InstallmentsTo.Text), DateValue(RentDate.Text))

and then I'm try translate that code in C#. But this code not working

//find maturities based on installments to ???private void SearchDueDate(){System.DateTime PaymentDate;System.DateTime RentDate;int InstallmentsTo;InstallmentsTo = Convert.ToInt32(txtcicilan_ke.Text);RentDate = Convert.ToDateTime(txttgl_pinjaman.Text);PaymentDate = Convert.ToDateTime(txttanggal_pembayaran.Text);DueDate.Text = Convert.ToDateTime(PaymentDate - RentDate), InstallmentsTo.ToString("yyyy/MM/dd");}

Answers (3)