I understand this might be considered a duplicate of this: Parse v. TryParse
But, could anybody tell me why this code threw an exception when Tryparse is not supposed to throw any exceptions at all?
If Int32.TryParse(txtOrdLine.Text.Trim, txtOrdLine.Text) = False Then
The value entered in txtOrdLine was "1-4".
The exception was that it could not convert string "1-4" to type Integer. This is on a code behind for a ASP.Net 4.5 site if that makes a difference.
Any information would be appreciated.
Thanks.