if a textbox has 1 digit or a number that’s larger than 31, the program will crash. how should I stop that?
so far, i have this code:
if (dd.Text.Length <= 1 || dd.Text > 31)
return;
obviously, that’s wrong… 🙁
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The above code is comparing a string to an int. You should try: