/// <summary>分页获取数据列表 /// /// </summary> /// <param name="strFields">字段</param> /// <param name="strOrder">排序</param> /// <param name="strOrderType">排序类型</param> /// <param name="intPageSize">每页大小</param> /// <param name="intPageIndex">当前第N页</param> /// <param name="strWhere">条件</param> /// <returns>返回符合条件的DataSet数据集</returns> public DataSet GetList(string strFields, string strOrder, string strOrderType, int intPageSize, int intPageIndex, string strWhere) { DataAccess4DBHelper.IDbHelper h = GlobalHelpDemoForm.GetDataAccessHelperDemo(); h.CreateStoredCommand("[proc_SplitPage]"); h.AddParameter("@tblName", "Sys_Roles"); h.AddParameter("@strFields", strFields); h.AddParameter("@strOrder", strOrder); h.AddParameter("@strOrderType", strOrderType); h.AddParameter("@PageSize", intPageSize); h.AddParameter("@PageIndex", intPageIndex); h.AddParameter("@strWhere", strWhere); DataTable dt = h.ExecuteQuery(); DataSet ds = new DataSet(); ds.Tables.Add(dt); return(ds); }
/// <summary>获得指定字段的数据列表(字段间用逗号隔开) /// /// </summary> /// <param name="strWhere">条件</param> /// <param name="strFields">字段</param> /// <returns>返回符合条件的DataSet数据集</returns> public DataSet GetList(string strWhere, string strFields) { StringBuilder strSql = new StringBuilder(); strSql.Append("select " + strFields + " "); strSql.Append(" FROM Sys_Roles "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } DataAccess4DBHelper.IDbHelper h = GlobalHelpDemoForm.GetDataAccessHelperDemo(); h.CreateCommand(strSql.ToString()); DataTable dt = h.ExecuteQuery(); DataSet ds = new DataSet(); ds.Tables.Add(dt); return(ds); }