How to pass float datatype into sql server. My sqlserver data type is float and function data type also float. I am trying pass text box values to that
that function it shows error like input string was not currect format
7 Replies - 4671 Views - Last Post: 26 May 2009 - 06:23 AM
#1
How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 04:23 AM
Replies To: How to pass float data type into sql server there is no toFloat functi
#2
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 04:36 AM
you need to convert the value in the textbox to a double. and also make sure it's an actual number.
This post has been edited by eclipsed4utoo: 26 May 2009 - 04:37 AM
#3
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 04:37 AM
try to use
Convert.ToDouble(txt.Text)
~Noor Ahmad~
This post has been edited by noorahmad: 26 May 2009 - 04:40 AM
#4
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 04:47 AM
#5
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 04:55 AM
try this
MessageBox.Show(Convert.ToDecimal(textBox1.Text).ToString());
#6
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 05:01 AM
ajeebaj, on 26 May, 2009 - 03:23 AM, said:
How to pass float datatype into sql server. My sqlserver data type is float and function data type also float. I am trying pass text box values to that
that function it shows error like input string was not currect format
that function it shows error like input string was not currect format
(float) Convert.ToDouble(txt.text) will work
#7
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 05:44 AM
and this is the main reason I stay away from using Float in SQL. I would suggest using the decimal datatype.
#8
Re: How to pass float data type into sql server there is no toFloat functi
Posted 26 May 2009 - 06:23 AM
float = Single
you can use either
you can use either
Convert.ToSingle("");
float.Parse("");
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|