Why you should use TryParse() in C# | Mark Jensen
Actually the documentation says that if the number cannot be parsed, the method assigns 0 to the second parameter: int quantity; int.TryParse(txtQuantity.Text, out quantity); So this is enough, you dont need assign 0 to quantity: Public Shared Function Tr...