The continue statement passes control to the next iteration of its closed iteration statement.

Source: Internet
Author: User

The continue statement passes control to the next iteration of its closed iteration statement.

Example

In this example, the counter is initially counted from 1 to 10, but(i < 9)The statement between the end of the continue and for loop body is skipped.

  Copy code
// statements_continue.csusing System;class ContinueTest {    static void Main()     {        for (int i = 1; i <= 10; i++)         {            if (i < 9)             {                continue;            }            Console.WriteLine(i);        }    }}

Output

 
910

Application in actual project

/// <Summary>
/// Save it to the database
/// </Summary>
Public void SaveFileToData (System. Windows. Forms. ProgressBar prg)
{
String SQL = "delete from Pro_ B _ByComPanyInfoData where [Year] = '" + this. tlsCmb. text + "'and ByComPanyID ='" + Pioneer. byCompanyInfo. pubShare. byCompanyID + "'";
Pioneer. OperatorData. Delete (SQL, Pioneer. PublicConnString. GetConnString); prg. Visible = true;
Prg. Minimum = 0;
Prg. Maximum = this. axF1Book1. NumSheets * 100;
For (Int16 I = 1; I <= this. axF1Book1. NumSheets; I ++)
{
AxF1Book1. Sheet = I;
For (int j = 1; j <= 100; j ++)
{
Prg. Value = prg. Value + 1;
String Value = this. axF1Book1. get_EntrySRC (I, j, 3); // The Value entered in the cell
String FiledsID = this. axF1Book1. get_EntrySRC (I, j, 1); // field ID
String FiledsName = this. axF1Book1. get_EntrySRC (I, j, 2); // field name
If (FiledsName. Trim () = "")
{
Continue;
}
String TableName = this. axF1Book1. get_SheetName (I). ToString (); // get the name
String TableID = Pioneer. operatorData. getString ("ID", "Pro_ B _ByComPanyInfo", "Where [Name] = '" + TableName + "'", Pioneer. publicConnString. getConnString );//
String SheetID = I. ToString (); // obtain the form number.
String SheetName = this. axF1Book1. get_SheetName (I). ToString (); // obtain the form name.
String Year = this. tlsCmb. Text; // Year
String ByComPanyID = Pioneer. ByCompanyInfo. PubShare. ByCompanyID; // Number of the audited Organization
SaveDataToDb (Value, FiledsID, FiledsName, TableID, TableName, SheetID, SheetName, Year, ByComPanyID );
}
}
Prg. Visible = false ;}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.