D
Dave Uphoff
When I make a change to a numeric field in a gridbox on an Update Command, the results are always rounded to the nearest dollar and always shows 2 decimal places of zeros even though I put in cents. My code for capturing the data is shown below:
System.Globalization.NumberStyles style = new System.Globalization.NumberStyles();
style = System.Globalization.NumberStyles.Any;
decimal amountowed = System.Decimal.Parse(tb.Text, style);
The code for updating the data is: cmd.Parameters.Add("@AmountOwed", OleDbType.Decimal);
cmd.Parameters["@AmountOwed"].Value = amountowed;
The amountowed variable shows the correct value before the update occurs but it still displays .00 for the cents on the gridbox.
I've tried using long an double also. My edit mask is {0:C} in the Property Builder and the field is defined as long with 2 decimal places in my Access data base. Anyone have any clues?
Dave Uphoff
System.Globalization.NumberStyles style = new System.Globalization.NumberStyles();
style = System.Globalization.NumberStyles.Any;
decimal amountowed = System.Decimal.Parse(tb.Text, style);
The code for updating the data is: cmd.Parameters.Add("@AmountOwed", OleDbType.Decimal);
cmd.Parameters["@AmountOwed"].Value = amountowed;
The amountowed variable shows the correct value before the update occurs but it still displays .00 for the cents on the gridbox.
I've tried using long an double also. My edit mask is {0:C} in the Property Builder and the field is defined as long with 2 decimal places in my Access data base. Anyone have any clues?
Dave Uphoff