Reputation: 4369
I have a numericupdown which will retrieve value from database, as following line
pd_qty.Value = Convert.ToDecimal(product.qty);
remarks: pd_qty is numericupdown, product.qty is string
When I run the form, the error occurs
An unhandled exception of type 'System.ArgumentOutOfRangeException'
#translated# error : '9999.0000' is not valid value for 'Value', Value should be between minimum and maximum
Upvotes: 0
Views: 1749
Reputation: 1504
The NumericUpDown
has a Minimum
and Maximum
property. If you haven't set these explicitly, the default is minimum 0, maximum 100. The value you are setting is either less than the minimum, or (very likely) greater than the maximum.
If you need to accept such large numbers, adjust the maximum:
pd_qty.Maximum = 10000;
Upvotes: 2