.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

Argument out of range exception

Posted By:Karthikeyan Anbarasan       Posted Date: January 13, 2011    Points: 15    Category:    URL: http://www.dotnetspark.com  

This code shows how to throw the argument out of range exception
 


            if (value >= 0 && value <= 10)
               intVal = value;
            else
               throw (new ArgumentOutOfRangeException("Val", value,
                  "Assign Value between 0 and 10."));

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend