想找原代码改成CQY方法
connection.Open();
dbTransaction = connection.BeginTransaction();
try
{
for (int i = 0; i < sqls.Length; i++)
{
StringBuilder builder = (StringBuilder)sqls[i];
if (builder != null)
{
SqlParam[] paramArray = (SqlParam[])param[i];
DbCommand sqlStringCommand = this.db.GetSqlStringCommand(builder.ToString());
//Insert Into sys_important_Logs(SyslogsId,OperationType) Values (@SyslogsId,@OperationType)
DbCommon.AddInParameter(db, sqlStringCommand, paramArray);
this.db.ExecuteNonQuery(sqlStringCommand, dbTransaction);
}
}
dbTransaction.Commit();
请问如何改
using (MProc proc = new MProc("Insert Into sys_important_Logs(SyslogsId,OperationType) Values (@SyslogsId,@OperationType)"))
{
??参数如何赋值
proc.ExeNonQuery();
}
proc.Set("SyslogsId",value,DBType.Int32).Set("OperationType",value,DbType.String)