using System.Data;
using System.Data.SqlClient;
I am using a SqlCommand cmd.Parameters of SqlDbType.DateTime to create a record in the database.
Seconds are not being stored in the database. The field in the db is of type datetime.
Do I need to do something special to save seconds, or does SqlDbType.DateTime not do that?
SqlDbType.DateTimemaps to SQL’sDATETIMEdatatype, which is accurate to 3.33 milliseconds. It sounds like you may be putting your values into aSMALLDATETIMEfield in SQL server, which is only accurate to the minute.SqlDbType.DateTimeparameter would be the correct choice for use with bothDATETIMEandSMALLDATETIME.