Converting TextBox input to decimal
Posted on 2006-04-25
I have a stored procedure that expects a decimal value. I am getting that value from a TextBox's Text property. The Text will only be two digits e.g. 11, or 25. I need to convert this Text to decimal type for use in a stored procedure that expects a decimal(3,2) type. I have tried adding "0." or "." to the beginning of the TextBox's Text property and then converting that string to decimal without success. I have also converted the Text to an int and divided it by 100, without success either. Can you tell me an easier way to do this, and if the Decimal types (C# and SqlType) are not the same?