Conditional expression inside Convert.ToString() evaluating wrong?
<p>I'm stumped. Why wouldn't the first and fourth lines evaluate to null?</p>

<p><img src="http://i.stack.imgur.com/Z7E32.png" alt="null wut"></p>

<p><strong>Post-answer edit:</strong></p>

<p>For the benefit of others, the desired behavior would be created by using:</p>

<pre><code>boolFoo ? null : Convert.ToString(DBNull.Value)
</code></pre>

<p>This works because <code>Convert.ToString()</code> and <code>null</code> imply a common type of <code>string</code>.</p>
