Your entire process is in a single Try/Catch block. That means if any single part fails, the entire things fails. You should break this up so that each individual calculation is in it's own try/catch.
[message] A first chance exception of type 'System.FormatE xception' occurred in mscorlib.dll [/message]
You know you have a format exception. So stop trying to integrate formating in your calls.
Take out all your "C" and "N" formatters. Just throw whatever string is made into the textbox to at least see if your calculations are working. *AFTER IT ALL CALCULATING* then you can format just one line and run it again. If that works, format one more line.
If you are only using F10 then you are skipping over the actual calculation part, for line-by-line stepping.
Since you want to debug the method that takes place after you click the [Calculate] button, that is where you should put the breakpoint: Inside the Calculate button handler.
Line 11 from your sample above.
Now you can step through the method causing trouble until you find the bug.
[message] A first chance exception of type 'System.FormatE xception' occurred in mscorlib.dll [/message]
You know you have a format exception. So stop trying to integrate formating in your calls.
Code:
DiscountTextBox.Text = DiscountedSumDecimal.ToString("C")
I have put in a breakpoint and went from line to line with F10
from this line
Expand|Select|W rap|Line Numbers
Const DISCOUNT_RATE_D ecimal As Decimal = 0.15D
from this line
Expand|Select|W rap|Line Numbers
Const DISCOUNT_RATE_D ecimal As Decimal = 0.15D
Since you want to debug the method that takes place after you click the [Calculate] button, that is where you should put the breakpoint: Inside the Calculate button handler.
Code:
Dim QuantityInteger As Integer
Now you can step through the method causing trouble until you find the bug.
Comment