hkguile
hkguile

Reputation: 4369

NumericUpDown error: Value should be between minimum and maximum

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

Answers (1)

Ian
Ian

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

Related Questions