how to implicitly write a future date to sql 2005 database table from c# visual studio 2005

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello everyone,
I am developing a visual studio 2005 C# windows form application such that I wish to update an SQL 2005 Express database table column implicitly with a date in the future.
<span style="text-decoration:underline Scenerio:
SQL 2005 Express database table column1 data (data type - int) is updated implimenting a stored procedure from VS C# windows application textbox1 text . Whenever database table column1
data (data type - int) becomes greater than or equal to (>=) 21 for instance, I wish that the C# application implicitly updates column2 data (data type - shortdatetime) of the same table with date 6 months from now (using
stored procedure).
I have no problem writing the SQL stored proceedure etc. All I need is the C# code that will implicitly write date exactly 6 months from now to the database table column2.

I can do the following with a datetimepicker:
cmd1.Parameters.AddWithValue("@column1", DateIssued.Text);
<span style="text-decoration:underline
I wish to do this: <br/>
cmd1.Parameters.AddWithValue("@column1",
Date 6 months from now );

Thank you in anticipation.<span style="text-decoration:underline
<span style="text-decoration:underline

View the full article
 
Back
Top