title: Default value SqlCommand.Parameters.Add C# Issue
body: <p>I have a program that connect to a database, use a stored procedure to insert a line in a table, and close the connection. Everything works ok instead of the line below.</p>
  
  <p>VisualStudio underline in red the last line :</p>
  
  <pre><code>string value = textBox_value.Text;
  
  command.Parameters.Add(new SqlParameter("@value", (String.IsNullOrEmpty(value)) ? DBNull.Value : value));
  </code></pre>
  
  <p>Error message : </p>
  
  <blockquote>
    <p>There is no explicit conversion between 'System.DBNull' and 'string'</p>
  </blockquote>
  
  <p><code>String.IsNullOrEmpty(value)</code> returns <strong>true</strong> if the value is empty, else returns <strong>false</strong>. </p>
  
  <p>I found the solution by writting this enourmous line of code :</p>
  
  <pre><code>if (String.IsNullOrWhiteSpace(value)) 
  {
          command.Parameters.Add(new SqlParameter("@value", DBNull.Value));
  }
  else 
  {
          command.Parameters.Add(new SqlParameter("@value", CT_Intitule));
  }
  </code></pre>
  
  <p>But is that normal we can't perform a one-line condition ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thanks to <em>Rahul Singh</em>, that pointed the MSDN documentation in which the function is described as expecting 2 same type, I resolved my issue doing this :</p>
  
  <pre><code>command.Parameters.Add
  (
      ( String.IsNullOrWhiteSpace(value) ) ? 
          new SqlParameter("@value", CT_Intitule) 
          : 
          new SqlParameter("@value", DBNull.Value)
  ); 
  </code></pre>