title: Is it possible to Pass Empty Parameter to sql server from code behind?
body: <p>I have few Parameter in my SQL Query which accepts only ' ' value it will not accept null, so I want to pass '' value as parameter how is that possible, below is my code which I am trying to do</p>
  
  <pre><code>param = new SqlParameter("@CodeNumber", SqlDbType.VarChar);
  if (!string.IsNullOrEmpty(SearchCriteria.CodeNumber))
    {
       param.Value = SearchCriteria.CodeNumber;
    }
  else
    {
      param.Value = DBNull.Value;
      //param.Value = ''; I want to pass something like this
    }
  cmd.Parameters.Add(param);
  
  
  param = new SqlParameter("@LicenseDate", SqlDbType.DateTime);
  if (SearchCriteria.LicenseDate != null &amp;&amp; SearchCriteria.LicenseDate != default(DateTime))
    {
        param.Value = SearchCriteria.LicenseDate;
    }
  else
    {
       param.Value = DBNull.Value;
       //param.Value = ''; I want to pass something like this
     }
  cmd.Parameters.Add(param);
  </code></pre>
  
  <p>I am not getting any error but in query it is not taking as ' '</p>