c# - FormatException was unhandled Input string was not in a correct format -


i want int value database. have error formatexception unhandled input string not in correct format.

my code

       string str = doc_cell.text;        ulong = convert.touint64(str); 

the problem comes because string convert not uint64, because of line throws exception.

you should write this:

uint64 =0; bool issuccess = uint64.tryparse(str, out a); 

in case have value of string in a, if parsing successful. if parsing not have 0 in a.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -