c# - Difference between (long)value and Convert.ToInt64(value) -


i've procedure gets value database dataset , copy local long typed variable. contains long value.

this how i'm copying value dataset variable.

areaid = dstable.searchedtable[i].isareaidnull() ? 0 : (long)dstable.searchedtable[i]["areaid"]; 

sometimes works fine gives me error

specific cast not valid

then have change these kind of conversion format

 areaid = dstable.searchedtable[i].isareaidnull() ? 0 : convert.toint64(dstable.searchedtable[i]["areaid"]); 

i'm confused what's wrong (long) when has same value both methods , 65. i'm missing on here??


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -