Exemple #1
0
 public string ExecuteDataList(WrapedDatabaseParameter parms)
 {
     long t = DateTime.Now.Ticks;
     try
     {
         DatabaseParameter[] pars = parms.DatabaseParameters ?? new DatabaseParameter[] { };
         DbParameter[] ps = ConvertParameter(pars);
         DAC dac = new DAC(parms.RoutingKey, parms.ConnectionString);
         string list = dac.ExecuteDataList(parms.CmdText, (CommandType)parms.CmdType, ps);
         Log.Write(LogAction.Svc, className, "ExecuteDataListWraped", parms.ConnectionString, parms.CmdText.TrimSql(128), DateTime.Now.Ticks - t, "执行成功:" + (CommandType)parms.CmdType + " " + pars.ToKeyString());
         return list;
     }
     catch (Exception e)
     {
         Log.Write(LogAction.Error, className, "ExecuteDataListWraped", parms.ConnectionString, parms.CmdText.TrimSql(128), DateTime.Now.Ticks - t, "执行出错:" + (CommandType)parms.CmdType + " " + parms + ";" + e.ToString());
     }
     return "[]";
 }
Exemple #2
0
 public string ExecuteDataTable(WrapedDatabaseParameter parms)
 {
     return ExecuteDataSet(parms).GetXml().Replace("\r\n", "").Replace(" ", "");
 }