Home All Groups Group Topic Archive Search About
Author
4 Jan 2006 5:06 PM
nbohana
I have to convert a textbox field that looks like "$800.00' that was setup by
using 'txtServiceCost.Text = ynum.ToString("C");'.  When I try to insert the
record into my SQL database I get a message that i need to use the convert
function on this data. The field id defined as money in the database.  It
seams that I must somehow convert this data to money, I cannot find a way to
do this.  Can someone point me in the right direction?  Thanks!!

--
Norm Bohana

Author
8 Jan 2006 9:41 PM
Elton W
Hi Norm,

You can use Convert.ToDecimal(stringValue) or Convert.ToDouble(stringValue)
to convert string to numerical value.  $ sign is easy to be removed by
string.Replace(“$”, “”).

HTH

Elton Wang

Show quote
"nbohana" wrote:

> I have to convert a textbox field that looks like "$800.00' that was setup by
> using 'txtServiceCost.Text = ynum.ToString("C");'.  When I try to insert the
> record into my SQL database I get a message that i need to use the convert
> function on this data. The field id defined as money in the database.  It
> seams that I must somehow convert this data to money, I cannot find a way to
> do this.  Can someone point me in the right direction?  Thanks!!
>
> --
> Norm Bohana

AddThis Social Bookmark Button