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 parenthesesCodePudding user response:
Using (var form=new RenderForm (_title)){
}
CodePudding user response:
Before using in the variable declaration does not make sense of theUsing 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;
}
}
}