i use the method adddays() to count date after 7 and 28 days from today or what ever date when im trying to insert the values into database table fields currect_date and crush_date date type fields it shows that adddays(28) value is not a correct date/time value.
DateTime d = new DateTime();
d = DateTime.Today;
cmd = new SqlCommand("insert into sq_crush (currect_date,crush_date) values ('" + d.AddDays(7).ToShortDateString() + "','" + d.AddDays(28).ToShortDateString() + "')", cn);
if (cn.State == ConnectionState.Closed)
cn.Open();
// MessageBox.Show(dd);
cmd.ExecuteNonQuery();
if i changed 28 to 14 it works without any troubles but if i used any value over 14 it shows the same error
"Conversion failed when converting date and/or time from character string."
How to make it work as it works with values under 14 and if there any other way to get dates after 28 or 23 or any number of days after one specific date.
In general I want to insert the date in three fields first one today second is the date after 7 days from the first date which I have no problems with this and the last one the date after 28 days Please help me