Convert

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!!
 
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
 
Back
Top