判断日期类型为空的情况

 

if (model.Pick_Up_Time.ToString() == "0001-1-1 0:00:00")

            {

                parameters[2].Value = System.DBNull.Value;

            }

            else

            {

                parameters[2].Value = model.Pick_Up_Time;

            }

你可能感兴趣的:(日期)