Server Error in '/' Application.

Conversion from type 'DBNull' to type 'String' is not valid.

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: Conversion from type 'DBNull' to type 'String' is not valid.

Source Error:


Line 33:         Dim ProductID As Integer = ParentID
Line 34:         dim products As ASPNET.StarterKit.Commerce.ProductsDB = New ASPNET.StarterKit.Commerce.ProductsDB()
Line 35:         Dim myProductDetails As ASPNET.StarterKit.Commerce.ProductDetails = products.GetProductDetails(ProductID)
Line 36: 
Line 37:         ' Update Controls with Product Details

Source File: D:\Clients\francisc\vintageviolins.ca\www\AddDetails2.aspx    Line: 35

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.StringType.FromObject(Object Value) +330883
   ASPNET.StarterKit.Commerce.ProductsDB.GetProductDetails(Int32 productID) +850
   ASP.adddetails2_aspx.Page_Load(Object sender, EventArgs e) in D:\Clients\francisc\vintageviolins.ca\www\AddDetails2.aspx:35
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3662; ASP.NET Version:2.0.50727.3668