A few days ago, the previous SQL Execution operations were switched to the sqlhelper operation method.
For convenience of debugging, the printing method of paramssql is customized.
After Params is passed and executed, you can call the following method to print the Params and value values.
SQL Params of sqlclient can be printed.
Applog is a custom debugging class.
You can switch to console. writeline/response. Write and other printing debugging methods. This makes it easy to understand the procedure execution process,
You don't need to debug the tracing.
Write_paramssql # Region Write_paramssql
/**/ /// <Summary>
/// Write_paramssql
/// </Summary>
/// <Param name = "myparams"> </param>
/// <Param name = "strprocedurename"> </param>
Public Static Void Write_paramssql (sqlparameter [] myparams, string strprocedurename)
{
String logsql = "" ;
For ( Int I = 0 ; I < Myparams. length; I ++ )
{< br> logsql + = myparams [I]. parametername + " = ' " + myparams [I]. value. tostring () + " ', \ n " ;
}
Applog. Log ( " Execute " + Strprocedurename + " " + Logsql );
}
/**/ /// <Summary>
/// Write_paramssql
/// </Summary>
/// <Param name = "mycommand"> </param>
/// <Param name = "strprocedurename"> </param>
Public Static Void Write_paramssql (sqlcommand mycommand, string strprocedurename)
{
String logsql = "" ;
For ( Int I = 0 ; I < Mycommand. Parameters. Count; I ++ )
{
Logsql + = Mycommand. Parameters [I]. parametername + " =' " + Mycommand. Parameters [I]. value. tostring () + " ', \ N " ;
}
Applog. Log ( " Execute " + Strprocedurename + " " + Logsql );
}
# Endregion