try { con.Open(); SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_PaymentTracker"; cmd.Parameters.AddWithValue("@Name", txtName.Text); cmd.Parameters.AddWithValue("@InvestmentType", txtInvestmentType.Text); cmd.Parameters.AddWithValue("@Amount", txtAmount.Text); cmd.Parameters.AddWithValue("@MonthlyPay", txtMonthlyPay.Text); cmd.Parameters.AddWithValue("@NumberOfMonths", txtNoOfMonths.Text); cmd.Parameters.AddWithValue("@StartDate", txtStartDate.Text); cmd.Parameters.AddWithValue("@EndDate", txtEndDate.Text); cmd.Parameters.AddWithValue("@Phone", txtMobile.Text); cmd.Parameters.AddWithValue("@Address", txtAddress.Text); cmd.Connection = con; cmd.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { con.Close(); con.Dispose(); txtName.Text = txtInvestmentType.Text = txtAmount.Text = txtMonthlyPay.Text = txtNoOfMonths.Text = txtStartDate.Text = txtEndDate.Text = txtMobile.Text = txtAddress.Text = string.Empty; }
convert txtStartDate to datetime, then follow the below code txtStartDate.AddMonths(txtNoOfMonths)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)