i am working on a project and i need to show a error message if the user enters string in a text box whose datatype is int??
it throws exception that input string is not in correct format...:(
Manak
0
Newbie Poster
Recommended Answers
Jump to PostHere you are
if(int.TryParse(TextBox1.Text)) //good else MessageBox.Show("Text couldn't be converted to integer");
All 5 Replies
Ramy Mahrous
401
Postaholic
Featured Poster
Manak
0
Newbie Poster
Ramy Mahrous
401
Postaholic
Featured Poster
Manak
0
Newbie Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.