int numVal = Convert.ToInt32("-105");
Error
Input string was not in a correct format.
Please suggest me any alternative to give <0 value in int
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.
Ashutosh GuptaPosted Jan 30, 2020, 10:14 AM
Convert.ToInt32() converts the string data to a proper true int32 value, and throws an exception if it can't convert the value.
Surya KantPosted Jan 30, 2020, 7:08 AM