User107

User107

  • NA
  • 28
  • 17.8k

Is it possible to convert string to float datatype inasp.net

Aug 30 2016 7:29 AM
In my web application, i need to display grid view in one column message string type that column have float data type in database. I am trying to convert string to float data type but it is not display properly what i have to do.
 
I tried this: 
string str1 = "Hi hello";
float f = float.Parse(str1);
dt
.Rows[i].SetField("Column Name",f);

I am getting Exception like "Input string was not in a correct format".
Is It Possible to convert string to float. Can anyone tell me how to do this.
Thank you
 


Answers (2)