Home > Net >  Var red wavy lines below
Var red wavy lines below

Time:11-02


Using var form=new RenderForm (_title);

Tip: error CS1026 should input)
Var below with red wavy lines,

As if to show variable declarations,


How to change?

CodePudding user response:

Using the back of the statement to write in parentheses

CodePudding user response:

Using (var form=new RenderForm (_title))
{

}

CodePudding user response:

Before using in the variable declaration does not make sense of the
Using usage one: the introduction of some system resources such as: using system...
Another is to release some of the bigger of the two resources expenses such as IO operations such as database connection. The net system will automatically detect the code will be used again later, at the right time to release the resources,

 public readonly string strcon=ConfigurationManager. ConnectionStrings [r]. "accesscon" ConnectionString; 
Public int ExecuteNonQuery (string cmdText, params OleDbParameter [] ¶s)
{
Using (OleDbConnection con=new OleDbConnection (strcon))
{
con.Open();
Using (OleDbCommand CMD=con. CreateCommand ())
{
Cmd.Com mandText=cmdText;
CMD. The Parameters. AddRange (¶s);
Int intresult=CMD. ExecuteNonQuery ();
CMD. The Parameters. The Clear ();
Return intresult;
}

}
}
  •  Tags:  
  • C#
  • Related