How do I insert a datetime value into a SQL database table where the type of the column is datetime?
DateTime time = DateTime.Now; // Use current time
string format = "yyyy-MM-dd HH:mm:ss"; // modify the format depending upon input required in the column in database
string insert = @" insert into Table(DateTime Column) values ('" + time.ToString(format) + "')";
and execute the query.
DateTime.Now is to insert current Datetime..