Server Error in '/' Application.

Object cannot be cast from DBNull to other types.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Object cannot be cast from DBNull to other types.

Source Error:


Line 617:			myProductDetails.Nom						= Convert.ToString(parameterNom.Value);
Line 618:			myProductDetails.Reference			= Convert.ToString(parameterReference.Value);
Line 619:			myProductDetails.Prix						= Convert.ToDouble(parameterPrixEuro.Value);
Line 620:			myProductDetails.PrixHT				= Convert.ToDecimal(parameterPrixHT.Value);
Line 621:			myProductDetails.PrixTTC				= Convert.ToDecimal(parameterPrixTTC.Value);

Source File: e:\SITESWEB\BroderieFacile\App_Code\Component\Products.cs    Line: 619

Stack Trace:


[InvalidCastException: Object cannot be cast from DBNull to other types.]
   System.DBNull.System.IConvertible.ToDouble(IFormatProvider provider) +60
   ProjetSite.Produits.GetProductDetails(Int32 productID) in e:\SITESWEB\BroderieFacile\App_Code\Component\Products.cs:619
   BOUTIQUE_Controls_Produit.Page_Load(Object sender, EventArgs e) in e:\SITESWEB\BroderieFacile\BOUTIQUE\Produit.ascx.cs:65
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4682.0