I have a datetime
datatype : dttm
Also the database field type is datatime
Now I am doing this:
if (dttm.HasValue)
{
cmd.Parameters.AddWithValue("@dtb", dttm);
}
else
{
// It should insert null value into database
// through cmd.Parameters.AddWithValue("@dtb", _____)
}
How can this be done.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…