2. You can't put null into a value type (int, double, etc.)
3. To check if you can convert text into an int:
Code:
try{
int value = int.Parse(text);
}catch(FormatException){
//handle failure to convert
}catch(OverflowException){
//handle failure to convert
}
Code:
int value; bool success = int.TryParse(text,
Leave a comment: