title: LinqToSql Nullable Column
body: <p>I have a table in my database which is named Patients. The table has a column which is named <strong>DOB</strong> and has Allow Null value to true. Here is the table structure:</p>
  
  <ul>
  <li>Id int IDENTITY(1,1) NOT NULL,</li>
  <li>FirstName nvarchar(50) NULL,</li>
  <li>LastName nvarchar(50) NULL,</li>
  <li>Sex bit NULL,</li>
  <li>Weight decimal(18, 0) NULL,</li>
  <li>Height decimal(18, 0) NULL,</li>
  <li><strong>DOB date NULL</strong>,</li>
  <li>PatientId nvarchar(50) NOT NULL</li>
  </ul>
  
  <p>I'm using LinqToSql. The problem is that when I want to set a null for DOB column then Visual Studio tells that DOB is not nullable. Here is my code:</p>
  
  <pre><code>Patient tblPatient = new Patient();
  if (txtYear.Text != "" &amp;&amp; txtMonth.Text != "" &amp;&amp; txtDay.Text != "")
                      tblPatient.DOB = Utility.ConvertPersianDateToGregorianDate(txtYear.Text + "/" + txtMonth.Text + "/" + txtDay.Text);
                  else
                      tblPatient.DOB = null;  // The error is in this line
  </code></pre>