title: C# boolean needs converted to bit for SQL Server so instead of True it needs to be 1
body: <p>I have a C# property which is of data type <code>bool</code> and when it gets set, it becomes a <code>True</code> or <code>False</code>.</p>
  
  <p>However I need for it to match up with a SQL Server table column of type <code>bit</code> so that it is saved as a 1 or 0.</p>
  
  <p>SQL Server column:</p>
  
  <pre><code>StormOut bit
  </code></pre>
  
  <p>C# property </p>
  
  <pre><code>public bool StormOut { get; set; }
  </code></pre>
  
  <p>C# SQL statement:</p>
  
  <pre><code>string querystring = "UPDATE tblSignOnOff SET StormOut = " + storm.StormOut + " WHERE id = 1902";
  </code></pre>
  
  <p>Otherwise currently the SQL statement in C# is </p>
  
  <pre><code>UPDATE tblSignOnOff 
  SET StormOut = True 
  WHERE id = 1902
  </code></pre>
  
  <p>Which results in an error:</p>
  
  <blockquote>
    <p>Invalid column name 'True'.</p>
  </blockquote>