title: Difference between Parameters.Add(string, object) and Parameters.AddWithValue
body: <p>I read the MSDN documentation and examples <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx" rel="noreferrer">here</a> and I know that the correct syntax for a <code>Paramters.Add</code> call is :</p>
  
  <pre><code>   command.Parameters.Add("@ID", SqlDbType.Int);
     command.Parameters["@ID"].Value = customerID; 
  </code></pre>
  
  <p>Where you have to specify the Parameter Name, the <code>SqlDbType</code> AND the Value with <code>.Value</code>.</p>
  
  <p>Now the correct syntax for a <code>Parameters.AddWithValue</code> call is :</p>
  
  <pre><code>   command.Parameters.AddWithValue("@demographics", demoXml);
  </code></pre>
  
  <p>Single line and skip the <code>Type</code> part.</p>
  
  <p>My Question is : How is it that when I do it like this,</p>
  
  <pre><code>   command.Parameters.Add("@demographics", demoXml);
     // .Add method with .AddWithValue syntax
  </code></pre>
  
  <p>I don't get any compiling error and even weirder, everything seems to work properly when the code is executed ?</p>