コード例 #1
0
        public static void CreateTable(Dictionary <string, object> tableInfo)
        {
            string str;
            BaseDbActionService service = DbAction.CurrentDB();;

            SQLHelper helper;

            str = ResolveCreateTableSql(tableInfo);

            try
            {
                helper = new SQLHelper(str, Array.Empty <object>());
                service.ExecuteNonQuery(helper);
            }
            catch (Exception e)
            {
                throw new Exception("数据表创建失败:执行语句\n" + str, e);
            }
            finally
            {
                service.Dispose();
            }



            return;
        }
コード例 #2
0
 /// <summary>
 /// sql执行
 /// </summary>
 /// <param name="helper"></param>
 /// <returns></returns>
 public int ExecuteNonQuery(SQLHelper helper)
 {
     try
     {
         return(db.ExecuteNonQuery(helper));
     }
     catch (Exception e)
     {
         throw e;
     }
     finally {
         db.Dispose();
     }
 }