2
Answers

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

User107

User107

8y
280
1
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)