Try this code:
SqlParameter unitsParam = command.Parameters.AddWithValue("@units", units);
if (units == null)
{
unitsParam.Value = DBNull.Value;
}
And you must check all other parameters for null value. If it null you must pass DBNull.Value value.