title: Object cannot be cast from DBNull to other types for Double Data Type
body: <p>I am seeing error when there is null value in database for any cell, Object cannot be cast from DBNull to other types.
  <strong>- Asp.net grid view</strong></p>
  
  <pre><code>&lt;asp:TemplateField ItemStyle-Width="120" HeaderText="Price Difference"&gt;
                                       &lt;ItemTemplate&gt;
  &lt;%# PercentageChange(DataBinder.Eval(Container.DataItem, "FirstPrice"),DataBinder.Eval(Container.DataItem, "SecondPrice")) %&gt;
  
                                       &lt;/ItemTemplate&gt;
                                   &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p><strong>C#</strong> </p>
  
  <pre><code>protected string PercentageChange(object client_Price, object second_price)
      {
         double price1 = Convert.ToDouble(client_Price);
              double price2 = Convert.ToDouble(second_price);
              double percentagechange = ((price1 - price2) / price2) * 100;
               return percentagechange ;
  } 
  </code></pre>