Click here to Skip to main content
15,881,776 members

Comments by Akos Orban (Top 1 by date)

Akos Orban 27-Nov-11 12:52pm View    
Try to add the datetime object as the value to your query, which is inserting the value to the table. If you are using ADO.NET something like this:
SqlCommand command = new SqlCommand("INSERT INTO saltrn (dat) VALUES(@date)", connection);
command.Parameters.Add("@date", SqlDbType.DateTime);
command.Parameters["@date"].Value = dtpdate.Value;
command.ExecuteNonQuery();

Also make sure that dtpdate.Value contains the proper value you want to save. Add a breakpoint at the insert statement, and check the value of it.