In my program, I insert a dtp value to my TSQL database as so:
con.Open();
string sql = "insert into Table(Date)values('"+dateTimePicker.Value.Date.ToString("yyyyMMdd")+"')";
com = new SqlCommand(sql, con);
com.ExecuteNonQuery();
con.Close();
con
and com
are the predefined SqlConnection and SqlCommand respectively.
I save it in a varchar(50)
format.
In my Edit
form, I want to retrieve it through a SELECT
statement and load it into the datetimepicker.
How do I do this?