Simple validation

Posted on 2007-10-10
Last Modified: 2010-04-15
In C#, how should I check for a value that has to be
4 or greater:

if (txtOne.Text.Trim()   ??  )  
Question by:MikeMCSD
    LVL 7

    Accepted Solution

    if(Convert.ToInt16(txtOne.Text))> 4)
    LVL 7

    Expert Comment

    by:Abu Hamdan
    if(Convert.ToInt16(txtOne.Text))>= 4)
    LVL 16

    Author Comment

    thanks hammdan . .
    I just came across "Int32.Parse()"
    Is there any difference?
    LVL 7

    Expert Comment

    by:Abu Hamdan
    No its the same ,, noth converts to integer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now