title: Operator '=' is not defined for type 'DBNull' and type 'Integer'
body: <p>I've been struggling for the past few hours and still can't get my head round this one . The issue I am having is when someone has been admitted  the database  updates giving them  BedID , when I then try and discharge them I can't seem to set the BedID (In the database)  to nothing . This is an issue as I need to be able to admit and discharge as many people as I can.</p>
  
  <pre><code>Sub Dis1_Click(ByVal s As Object, ByVal e As EventArgs) Handles Dis1.ServerClick
  
      Dim time As String = Now().ToString("dd-MM-yyyy hh:mm:ss")
  
      sql = "UPDATE Allocation  SET BedID = NULL , DischargeDate =" + "'" + time + "'" + " WHERE BedID = 1 "
      cmd = New OdbcCommand(sql, cn)
      cmd.ExecuteNonQuery()
  End Sub
  
  Sub BedCheck1()
      If r("BedID") = "" Then
      Else
          If r("BedID") = 1 Then
              ba = s &amp; "&lt;tr&gt;&lt;td&gt;" &amp; r("Surname") &amp; "&lt;/td&gt;" &amp; "&lt;td&gt;" &amp; r("Forename") &amp; "/&lt;td&gt;" &amp; "&lt;td&gt;" &amp; r("AdmitDate") &amp; "&lt;/td&gt;" &amp; "&lt;td&gt;" &amp; r("DischargeDate") &amp; "&lt;/td&gt;" &amp; "&lt;td&gt;" &amp; r("comments") &amp; "&lt;/td&gt;&lt;/tr&gt;"
          End If
      End If
  End Sub
  </code></pre>
  
  <p>Thanks! </p>