Minimum & Maximum Dates in code
When updating Sql columns that need a minimum or maximum date, consider using the defaults from the System.Data.SqlType namespace:
1: DateTime minDate = SqlDateTime.MinValue.Value
<pre><span class="lnum"> 2: </span> </pre> <pre class="alt"><span class="lnum"> 3: </span><span class="rem">// and</span></pre> <pre><span class="lnum"> 4: </span> </pre> <pre class="alt"><span class="lnum"> 5: </span>DateTime maxDate = SqlDateTime.MaxValue.Value</pre>
This can be a lot safer than putting hard-coded "magic date" constants in your code.