I am seeing error when there is null value in database for any cell, Object cannot be cast from DBNull to other types. - Asp.net grid view
<asp:TemplateField ItemStyle-Width="120" HeaderText="Price Difference">
<ItemTemplate>
<%# PercentageChange(DataBinder.Eval(Container.DataItem, "FirstPrice"),DataBinder.Eval(Container.DataItem, "SecondPrice")) %>
</ItemTemplate>
</asp:TemplateField>
C#
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 ;
}