converting String to Int in C# -


i have string

string  w =  y + "/" + fromrow[col2.columnname]; 

and w returns value 0/5

"0/5" , have convert on int32 . tried

int.parse, showing error input string not in correct format.

string w="0/5" int m=int32.parse(w) 

i have tried convert.toint32 showing error.

    string w="0/5"     int m=convert.toint32(w) 

an integer single number no decimal part, e.g., 3, 28, -76, 154, etc. have string, "0/5". "0/5" doesn't represent number (especially you've said it's not fraction), can't converted integer because it's not same kind of data. you'll need change data type of column want store in, or store data in different way (e.g. store 2 integers in separate columns).


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -