Hi,
I have no idea why am getting this kind of error,
"Input was not in the correct format"
here is my line of codding...
int userid = int.Parse(i.SubItems[3].Text);
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 4, 2014, 5:57 AM
What in fact does it contain?
Incidentally, you can guard against errors of this type by using int.TryParse rather than int.Parse:
int userid;
int.TryParse(i.SubItems[3].Text, out userid);
// userid will contain 0 if the Text property contains something non-integral
Vikram AgrawalPosted Dec 4, 2014, 5:45 AM
can you describe what is i in your code?
EnosPosted Dec 4, 2014, 5:06 AM
Manish Kumar ChoudharyPosted Dec 4, 2014, 5:01 AM