Ejemplo n.º 1
0
        /// <summary>
        /// 筛选
        /// </summary>
        public static DataSet Sql(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]);
                }
            }

            DataSet ds = db.ExecuteDataSet(sql);
            db.Dispose();

            return ds;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 筛选
        /// </summary>
        public static DataSet Select(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]);
                }
            }

            DataSet ds = db.ExecuteDataSet(DBSql.Select(table, top, field, where, order));
            db.Dispose();

            return ds;
        }