title: sql bit allow null ef4
body: <p>I have in my database the following table </p>
  
  <p><strong>table questions</strong></p>
  
  <p>question_id int</p>
  
  <p>answer  bit nullble</p>
  
  <p>question string </p>
  
  <pre><code> &lt;Property Name="questionlog_id" Type="int" Nullable="false" oreGeneratedPattern="Identity" /&gt;
            &lt;Property Name="question_id" Type="int" Nullable="false" /&gt;
            &lt;Property Name="answer" Type="bit" Nullable="true" /&gt;
  </code></pre>
  
  <p>in the entity framework, when i addObject it automatically set the answer to false (if no value has been given )</p>
  
  <pre><code>questions q = new questions(){
  question="blalala"
  } 
  context.Addobject(q);
  context.SaveChanges();
  </code></pre>
  
  <p>q.answer returns False</p>
  
  <p>and error if i try to save it as null </p>
  
  <pre><code>questions q = new questions(){
  question="blalala",
  answer=null
  } 
  context.Addobject(q);
  context.SaveChanges();
  </code></pre>
  
  <p>returns error</p>
  
  <p>what can i do to set the default value as null</p>