a column in my db is called cost. the type of this column is float. i am using visual studio . NET. A user enters the cost into a textfield on the form. i use the code:
float fCost = Convert.ToInt64(TextBox9.Text);
this works fine when numbers are entered into TextBox9.Text but when i try to enter a cost with a decimal point eg 9.99 i get an error.
when i use
double fcost = Convert.ToDouble(TextBox9.Text);
the error says cannot convert from double to float.
any suggestions?
float fCost = Convert.ToInt64(TextBox9.Text);
this works fine when numbers are entered into TextBox9.Text but when i try to enter a cost with a decimal point eg 9.99 i get an error.
when i use
double fcost = Convert.ToDouble(TextBox9.Text);
the error says cannot convert from double to float.
any suggestions?