public override System.Web.Profile.ProfileInfoCollection GetAllProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords) { System.Web.Profile.ProfileInfoCollection piCol = new System.Web.Profile.ProfileInfoCollection(); using (DataSet ds = this.OpenXml()) { DataTable dt = ds.Tables["Profile"]; totalRecords = dt.Rows.Count; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; DataRow[] drProfData = ds.Tables["ProfileData"].Select(string.Format("ProfileId = '{0}'", dr["ProfileId"])); int profSz = 0; for (int j = 0; j < drProfData.Length; j++) { profSz += drProfData[j]["PropertyValue"].ToString().Length; } System.Web.Profile.ProfileInfo pi = new System.Web.Profile.ProfileInfo((string)dr["UserName"], (bool)dr["IsAnonymous"], (DateTime)dr["LastActivityDate"], (DateTime)dr["LastUpdatedDate"], profSz); piCol.Add(pi); } } return(piCol); }
public override System.Web.Profile.ProfileInfoCollection GetAllProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords) { System.Web.Profile.ProfileInfoCollection piCol = new System.Web.Profile.ProfileInfoCollection(); using (DataSet ds = this.OpenXml()) { DataTable dt = ds.Tables["Profile"]; totalRecords = dt.Rows.Count; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; DataRow[] drProfData = ds.Tables["ProfileData"].Select(string.Format("ProfileId = '{0}'", dr["ProfileId"])); int profSz = 0; for (int j = 0; j < drProfData.Length; j++) profSz += drProfData[j]["PropertyValue"].ToString().Length; System.Web.Profile.ProfileInfo pi = new System.Web.Profile.ProfileInfo((string)dr["UserName"], (bool)dr["IsAnonymous"], (DateTime)dr["LastActivityDate"], (DateTime)dr["LastUpdatedDate"], profSz); piCol.Add(pi); } } return piCol; }