System.IndexOutOfRangeException: MemberCount

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/15/2013 1:39:08 AM
Gravatar
Total Posts 13

System.IndexOutOfRangeException: MemberCount

Halo,

After upgrading to 2.3.9.6 MSSQL I got the below error when adding user or viewing the Role Administration page.

Please help.

Thanks.

MemberCount

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IndexOutOfRangeException: MemberCount

Source Error: 

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 
 

[IndexOutOfRangeException: MemberCount] System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +146 System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +103 System.Data.SqlClient.SqlDataReader.get_Item(String name) +15 mojoPortal.Business.Role.GetbySite(Int32 siteId) +415 mojoPortal.Web.AdminUI.RoleManagerPage.BindRoleList() +47 mojoPortal.Web.AdminUI.RoleManagerPage.PopulateControls() +39 mojoPortal.Web.AdminUI.RoleManagerPage.Page_Load(Object sender, EventArgs e) +72 System.Web.UI.Control.OnLoad(EventArgs e) +74 mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) +15 System.Web.UI.Control.LoadRecursive() +120 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2848

3/15/2013 8:59:14 AM
Gravatar
Total Posts 18439

Re: System.IndexOutOfRangeException: MemberCount

What version did you upgrade from?

What version does it say for mojoportal-core under Administration > System Information?

It seems like you did not run all the upgrade scripts or did not deploy all the files for upgrade.

 

3/15/2013 10:41:39 AM
Gravatar
Total Posts 13

Re: System.IndexOutOfRangeException: MemberCount

From 2.3.9.3, now it's on 2.3.9.6 I got this error prior to upgrading so I thought it would fix it. But I still got the same error. I just extracted the latest zip package over the existing site. Is there a way I can update the SQL script manually? Thanks
3/15/2013 11:06:07 AM
Gravatar
Total Posts 18439

Re: System.IndexOutOfRangeException: MemberCount

That doesn't make sense. The changes to add MemberCount (which the error complains about) to that stored procedure were in version 2.3.8.5 (11 months ago). Nothing in recent versions has changed the related stored procedure. So it makes no sense that you get that error now but did not get it before upgrading from 2.3.9.3.

I would run this sql statement to fix this and hope that there are no other strange anomalies with your installation:

ALTER PROCEDURE [dbo].[mp_Roles_Select]

/*
Last Modified:        2012-04-10 Joe Audette

*/
    
@SiteID  int

AS

SELECT  
r.RoleID,
r.SiteID,
r.RoleName,
r.DisplayName,
r.SiteGuid,
r.RoleGuid,
COUNT(ur.UserID) As MemberCount

FROM        [dbo].mp_Roles r

LEFT OUTER JOIN [dbo].mp_UserRoles ur
ON        ur.RoleID = r.RoleID

WHERE       r.SiteID = @SiteID

GROUP BY
r.RoleID,
r.SiteID,
r.RoleName,
r.DisplayName,
r.SiteGuid,
r.RoleGuid

ORDER BY r.DisplayName


GO

 

The above is from the script:

/Setup/applications/mojoportal-core/SchemaUpgradeScripts/mssql/2.3.8.5.config

​Hope that helps,

Joe

3/15/2013 12:00:41 PM
Gravatar
Total Posts 13

Re: System.IndexOutOfRangeException: MemberCount

Works like a charm :) Thanks a lot! 

Actually i made a huge jump, the site was on 2.3.8.5 before i upgraded it to 2.3.9.3. We rarely add user to the site so i didn't notice it until yesterday when we needed to add one. 

Thanks for you help :)

3/15/2013 12:03:28 PM
Gravatar
Total Posts 13

Re: System.IndexOutOfRangeException: MemberCount

Oh btw, I'd like to share some of my sites using mojoportal :)

www.cocobeach.com
www.flamesource.ae
www.bodyworxme.com
www.zensuals-me.com
www.alqaditourism.com
www.tasweeqpro.com
www.50words.org

Thanks again :)

3/15/2013 12:23:16 PM
Gravatar
Total Posts 18439

Re: System.IndexOutOfRangeException: MemberCount

Those sites all look very nice! Good work on the designs.

4/17/2013 2:09:02 AM
Gravatar
Total Posts 13

Re: System.IndexOutOfRangeException: MemberCount

Hi Joe,

Sorry to bother you again, but i hope you could help me out. I'm now getting this error whenever i tried to add/create a new user. 

Server Error in '/' Application.

Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[IndexOutOfRangeException: Index was outside the bounds of the array.] mojoPortal.Data.SqlParameterHelper.DefineSqlParameter(String paramName, SqlDbType type, String typeName, Int32 size, Byte precision, ParameterDirection dir, Object value, Boolean sizeProvided, Boolean precisionProvided) +565 mojoPortal.Data.DBSiteUser.GetSingleUserByLoginName(Int32 siteId, String loginName, Boolean allowEmailFallback) +428 mojoPortal.Business.SiteUser.LoginExistsInDB(Int32 siteId, String loginName) +278 mojoPortal.Web.AdminUI.ManageUsers.CreateUser() +210 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804

 

Any idea? sad

THanks in advance.

 

4/17/2013 11:36:20 AM
Gravatar
Total Posts 18439

Re: System.IndexOutOfRangeException: MemberCount

What version of mojoPortal? I suggest upgrade to the latest version.

4/17/2013 12:31:34 PM
Gravatar
Total Posts 13

Re: System.IndexOutOfRangeException: MemberCount

Currently on 2.3.9.4. I also tried the upgrade but still got the same error. I'm thinking of creating a fresh new site if all else fails... How can i preserve all the data and settings? Is it possible to import just the data and settings to a new mojo db?

4/17/2013 12:50:15 PM
Gravatar
Total Posts 18439

Re: System.IndexOutOfRangeException: MemberCount

That error does not exist in the latest version, so I do not see how it could happen after upgrading unless you did not run the setup page or did not upload all of the new files. Nothing about making a new site would solve this error, if that error happens you would get the same error with a new site.

Upgrading does not lose any data but I would backup everything first.

You must sign in to post in the forums. This thread is closed to new posts.