i have one form named set borrow duration.
where i have one textbox,one update button..
Requirement of the system:
The system shall be able to add these durations to return book date. E.g. 1st june is issued date then the return date SHALL be issue date+14 days i.e. 15 June SHALL be returned date of book.
i have tried likes this::
private void buttonUpdate_Click(object sender, EventArgs e)
{
SqlConnection connect = new SqlConnection(str);
connect.Open();
{
string newdate = textBox_Borrow.Text;
string sqlquery = "UPDATE Burrow_Duration SET Days=@newdate";
SqlCommand cmd = new SqlCommand(sqlquery, connect);
cmd.Parameters.AddWithValue("@newdate", textBox_Borrow.Text);
cmd.ExecuteNonQuery();
this.Close();
while executing the above code if burrow duration days is 5 then when i type 10 in textbox, database gets update ie 10 comes in database..because i have insert update query.
but i want like if 5+14=19 (14)should be automatically be inserted...
10+14=24 (14) should be automatically be Inserted!!!
can any body help me out!!!<strike></strike>