How to count number of errors ? and if there is no errors how to go to......if (errorprovider1.GetError != "") { }

 private void btn_Click(object sender, EventArgs e)
        if(textBox1.Text == "")
        errorprovider1.SetError(textBox1, "fill the field");//count the error
        if(textBox2.Text == "")
        errorprovider1.SetError(textBox2, "fill the field");//count the error
        if(textBox3.Text == "")
        errorprovider1.SetError(textBox3, "fill the field");//count the error
        if (errorprovider1.GetError != "")//if there is no error

You could use a helper variable:
private void btn_Click(object sender, EventArgs e)
int n_errors = 0;
if (textBox1.Text == "")
errorprovider1.SetError(textBox1, "fill the field");//count the error
n_errors++;
if (textBox2.Text == "")
errorprovider1.SetError(textBox2, "fill the field");//count the error
n_errors++;
if (textBox3.Text == "")
errorprovider1.SetError(textBox3, "fill the field");//count the error
n_errors++;
if (n_errors == 0)//if there is no error
You still need to check the Text property of all three TextBoxes.
Hope that helps.
Please remember to close your threads by marking all helpful posts as answer then start a new thread if you have a new question.

Similar Messages

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • How to count number of ones in table

    Hello,
     i created one table 16x32 each cell is updating 1 byte of data,how to count number of one in all cell,and is it right way to calculate check sum??
    thank you

    The simplest way is to call GetTableCellRangeValues with VAL_ENTIRE_TABLE as the range, next summing array elements.
    But I don't understand your comment on checksum, so this may not be the more correct method for your actual needs: can you explain what do you mean?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Need help to count number of rows and display in file

    Hello,
    my scenario is IDOC to File......i am using XSLT mapping and using FCC parameters to convert the flat file.
    now new requirement is i need to count number of rows and add count value last of the file.
    Please let me know how to do it,
    thanks in advance for your help.
    Regards,
    Chinna

    thanks again, one more Q.
    in XSLT mapping i have written for loop for complete structure.
    example : <Details>
                         <node1>
                         <node2>
                   </details>
    in XSLT mapping
                         <xsl:for-each select="ZMATMAS_01/IDOC/E1MARAM">
         <Details>
         </Details>
         </xsl:for-each>
    if i add the field at target side....then i will come under details node and it will be repeated.
    how to declare in XSLT mapping.

  • How to count number of rows in table

    can I get number of row in table except Count(*) in pl/sql
    is there any other way

    Also posted and answered here
    how to count number of rows in table
    count(*) will be the fastest way. It is only slow if the table has a vast number of rows, in which case why do you need to know the tables has 73552436467721 rows and not 73552436467737 rows. It doesn't seem to be much use. Either that or you are counting them a lot, which again seems rather pointless.

  • Please let me know how to Count Number of completed line items in past 6 mo

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how
    Krishna

    Hi Experts,
    I dont have a defined Restricted key figure yet.
    I have populated 0COMPL_DEL(Delivery Completed Indicator)  and 0EBELN (Purchasing Document Number) and 0EBELP (Line Item Number in Purchasing Document) .
    This is what I think how I need to calculate:
    Number of completed line items in past 6 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 6 months
    and
    Number of completed line items in past 12 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 12 months
    Please let me know if the logic is correct. If so, how I can create this in report

  • I have a question about the new version of itunes. in the old version at the bottom of the sceen it display the total number of media and the size of the files. how can i get the new version to diplay this?

    in the old version at the bottom of the sceen it displayed the total number of media and the size of the files. how can i get the new version to diplay this?

    You're welcome. It was frustrating for me as well until I stumbled across "the fix"

  • How to count number of online user

    i am developing bid application using servlet/jsp. how to count number of online user ple help me.

    hi,
    may be the following code help you...
    import javax.servlet.http.HttpSessionListener;
    import javax.servlet.http.HttpSessionEvent;
    public class ActiveUserCount implements HttpSessionListener {
         private static int activeUsers = 0;
         public void sessionCreated(HttpSessionEvent se) {
              activeUsers++;
         public void sessionDestroyed(HttpSessionEvent se) {
              if(activeUsers > 0)
                   activeUsers--;
         public static int getActiveUsers() {
              return activeUsers;
    }Dhaval

  • HT1725 A rental movie stopped downloading and says there was an error. I am unable to get the download to resume.

    How can I resume a movie rental download when it has been interrupted and says there was an error?

    Getting used to changes in the finder. I finally did see the Adobe Patch installer and am able to update applications individually. Should be able to attend to the main apps I use w/o further difficulty. Thnx for the help.

  • I have a song that wont download  that i just bought from the itunes store and it says that it is corrupted and that there is an error that is err=100000

    i have a song that wont download  that i just bought from the itunes store and it says that it is corrupted and that there is an error that is err=100000

    I just posted a possible solution here - https://discussions.apple.com/message/17908124#17908124

  • The company I work for has given me an iPhone, but I haven't been able to download any apps. I've created an apple account, it claimed that it had been verified, but everytime I go to download something, it verifies again and claims there's an error.

    The company I work for has given me an iPhone, but I haven't been able to download any apps. I've created an apple ID account, it claimed that it had been verified, but everytime I go to download something, it verifies again and claims there's an error. I've tried this now with 3 different emails, and the message reads: go to the iTunes support page. I've emailed Apple, and they were extremely unhelpful. I was given the most vague responses by Bidyut from the iTunes Store Customer service team. I would just like to be able to use this phone since I'm paying for it.

    It might be helpful if you told us exactly what the error was... If you don't give us specifics, the best you're going to get is vague responses.

  • Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Since your Mac probably came with 10.4, there is no longer a way to get 10.5 Leopard install media. IF it has the requirements, you may be able to upgrade to 10.6 Snow Leopard by buying the boxed install media at the Apple Store for $30.
    System requirements are found here: http://support.apple.com/kb/SP575
    General support can be found here: http://www.apple.com/support/snowleopard/

  • When I try to open a pdf file I get an error message stating "There was an error opening the document.  The file is damaged and could not be repaired."  Other pdf files open fine.

    When I try to open a pdf file I get an error message stating "There was an error opening the document.  The file is damaged and could not be repaired."  Other pdf files open fine.

    You need to get a new copy of the PDF.

  • Photoshop suddenly does not print to Epson 3880 - PROBLEM: Cannot print from Photoshop  After restart error message appears:  - "There was an error opening your printer. Printing functions will not be available until you have selected a printer and reopen

    PROBLEM: Cannot print from Photoshop
    After restart error message appears:
    — “There was an error opening your printer. Printing functions will not be available until you have selected a printer and reopened any documents.”
    • All print commands are greyed out and unavailable — even to call up the printer commands cannot be done.
    The printer printed fine until about 2 weeks ago when this error message appeared.  Printing continues from Pages, I-photo, preview etc. —  only Photoshop fails.
    The printer has been turned on and off, as have open documents been closed and open etc..   Preferences reset.  Repeatedly I have read through blogs and forums and attempted to contact Adobe — all without results
    Epson support struggled to find reason and several solutions were tried and they assume this is an Adobe problem.
    Running Mac Powerbook X 10.10.2 / Photoshop CS6 13.0.6.x64
    Attempting unsuccessfully to print to Epson 3880
    What Adobe support will be of help.
    Robert Darling —  2/19, 20, 21,22,23/2015

    Probably best to ask in Photoshop General Discussion
    This forum is about the Cloud as a delivery process, not about using individual programs
    If you start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Anytime I try to download pages to my MacBook Pro a window comes up that says we could not complete your request and that there was an error in the app store. someone please help

    anyime that i try to download pages on my macbook pro from the app store a window comes up that says we could not complete your request and that there was an error in the app store. someone please help

    Error
    what is error code 1009?

Maybe you are looking for

  • My Xerox Phaser 6120 is no longer compatible with Firefox. There is no new driver. How can I revert to a previous version so I can browse AND print?

    For a few months, I have been unable to print from Firefox. I assumed it was a setting or something on my network, but today figured out it's my old printer driver that is no longer compatible. There is no new driver, nor will there be one. I love my

  • OSX 10.6.8 update Excel problems. When is it safe to proceed?

    I installed OSX10.6.8 and immediately had problems with Microsoft products specifically opening files using ommand o, printing all ways. I did what the boards seem to be suggesting (used disk utility to verify the disk (OK), repair permissions (Done)

  • Adding Column In Grid

    Hello All, In SBO,I want to add a column in Grid that is system defined.How is it possible. Can anyone help me,it's urgent Pls.

  • How can I add a button that opens a new tab?

    How can I quickly open a new (blank) tab without going to File --> Open New Tab. There has to be a button I can add or a box that isn't checked somewhere. I used to be able to click in the blank space in the row of tabs to open a new tab, but with th

  • Pattern Exception

    HI All I am developing a semi seach engine. I want to split the string using (+) operator. I write the following code:           } else if( source.contains("+")) {             words = source.split("+");             for ( String str : words ) {