Ejemplo n.º 1
0
        /// <summary>
        /// 统计
        /// </summary>
        public static int Count(string table, string where, List<string> list = null)
        {
            DBHelper db = new DBHelper();

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

            int row = Convert.ToInt32(db.ExecuteScalar(DBSql.Count(table, where)).ToString());
            db.Dispose();

            return row;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 单行数据
        /// </summary>
        public static string Row(string table, string field, string where, List<string> list = null)
        {
            DBHelper db = new DBHelper();

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

            string row = db.ExecuteScalar(DBSql.Select(table, 1, field, where, String.Empty)).ToString();
            db.Dispose();

            return row;
        }