title: how do I pass a database NULL value to a string variable?
body: <p>Basically if a parameter comes in as NULL, I want to send it to the database as a database NULL. As such (look at the comment inside the code below):</p>
  
  <pre><code>[HttpPost]
      public void UpdateTitle(Title title)
      {
        string query = null;
        string description = "";
        string episodeAKA = "";
  
        if (title.Description != null)
        {
          description = "'" + title.Description + "'";
        }
        else
        {
          //here's where description should be a DBNULL. 
        }
  
        if (title.EpisodeAKA == null)
        {
          title.EpisodeAKA = "NULL";
        }
  
        myConnection.Open();
        if (title.Operation == 'U')
        {
          query = "UPDATE dbo.AWD_Titles SET AwardStatusId = " + title.AwardStatus + ", Description = " + description + ", IsVerified = " + title.IsVerified + ", EpisodeAKA = '" + title.EpisodeAKA + "' WHERE AwardTitleId = " + title.AwardTitleId + " SELECT SCOPE_IDENTITY()";
        }
        var cmd = new SqlCommand(query, myConnection);
        cmd.ExecuteScalar();
        myConnection.Close();
      }
    }
  </code></pre>
  
  <p>And here's the class for Title:</p>
  
  <pre><code>public class Title
  {
    public int AwardTitleId
    {
      get;
      set;
    }
  
    public int AwardStatus
    {
      get;
      set;
    }
  
    public int IsVerified
    {
      get;
      set;
    }
  
    public string EpisodeAKA
    {
      get;
      set;
    }
  
    public string Description
    {
      get;
      set;
    }
  
    public char Operation
    {
      get;
      set;
    }
  }
  </code></pre>