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

RE: Convert by EltonW

EltonW
Sun Jan 08 15:41:03 CST 2006

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

"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