title: What's the best way to write "nulls" to SQL database when presenting options in combobox?
body: <p>I'm writing a front end to a database, presenting options as comboboxes. And I need to be able to return nulls to the database. </p>
  
  <p>I have a solution at the moment which involves 'fudging' a record into the query to populate the Datatable, then detecting the selection and hard coding <code>null</code> into my update statement if this item has been selected. </p>
  
  <pre><code>--GetDataByAvailableTechs query 
              SELECT     tblLEMSCredentialsId, TechNumber
              FROM         tblLEMSCredentials AS aLEMSCreds
              UNION ALL
              SELECT     '99999' AS Expr1, '&lt;NONE&gt;' AS Expr2
  </code></pre>
  
  <p>.  </p>
  
  <pre><code>            //populate combo box
              BV_LEMSHIPDataSet.tblLEMSCredentialsDataTable dtAvailableTechs = taLEMSCreds.GetDataByAvailableTechs(selectedSerial);  
              cboTechNumber.DataSource = dtAvailableTechs;
  </code></pre>
  
  <p>.  </p>
  
  <pre><code>            //Save back to DB
              if (lemsCredsID == 99999)
              {
                  taDevice.UpdateQuery_Restage(null, selectedSerial);
              }
              else
              {
                  taDevice.UpdateQuery_Restage(lemsCredsID, selectedSerial);
              }
  </code></pre>
  
  <p>Can anyone suggest a better way of doing this please? I need to make the application cope with another 5 similar fields and don't want to create a multitude of if else versions of my update. </p>
  
  <p>G</p>