Server Error in '/' Application.

Attempted to divide by zero.

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.DivideByZeroException: Attempted to divide by zero.

Source Error:


Line 512:                        Dim change As Decimal
Line 513:                        If (Decimal.TryParse(dtHistory.Rows((i + 1))("TotalAssesment").ToString, prevA) AndAlso Decimal.TryParse(dtHistory.Rows(i)("TotalAssesment").ToString, nextA)) Then
Line 514:                            change = ((nextA - prevA) / (prevA * CType(100, Decimal))) * 10000
Line 515:                            aChange = change.ToString("F1")
Line 516:                        Else

Source File: E:\WebSites\njtaxrecords.com\PropertyDetails.aspx.vb    Line: 514

Stack Trace:


[DivideByZeroException: Attempted to divide by zero.]
   System.Decimal.FCallDivide(Decimal& d1, Decimal& d2) +0
   System.Decimal.Divide(Decimal d1, Decimal d2) +23
   PropertyDetails.LoadTaxHistory(String CountyDist, String taxID) in E:\WebSites\njtaxrecords.com\PropertyDetails.aspx.vb:514
   PropertyDetails.Page_Load(Object sender, EventArgs e) in E:\WebSites\njtaxrecords.com\PropertyDetails.aspx.vb:409
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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