Exemplo n.º 1
0
        /// <summary>
        /// 筛选
        /// </summary>
        public static dynamic SqlReader(string sql, List<string> list = null)
        {
            DBHelper db = new DBHelper();

            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    db.ParameterAdd("@" + i, list[i]);
                }
            }

            dynamic dy = db.ExecuteReader(sql);
            db.Dispose();

            return dy;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 筛选
        /// </summary>
        public static dynamic Query(string table, int top, string field, string where, string order, List<string> list = null)
        {
            DBHelper db = new DBHelper();
            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    db.ParameterAdd("@" + i, list[i]);
                }
            }

            dynamic d = db.ExecuteReader(DBSql.Select(table, top, field, where, order));
            db.Dispose();

            return d;
        }