Index was out of range. Must be non-negative and less than the size of the collection- MS CRM 4.0


Most of the time you will get this error when you will try to retrieve data from Grid View, and it has no rows. But if you have rows in Grid View, make sure you have enabled view state. If you have already enabled view state but you are still getting this error and you have deployed your webapplication under ISV folder in MS CRM 4.0, then here is the issue.

MS CRM web.config file overrides setting of your web application, so you need to specifically change web.config file of MS CRM. You need
to change lines in web.config file like below

<pages buffer=”true” enableSessionState=”true” enableViewState=”true” validateRequest=”false”/>

                                   <sessionState mode=”InProc”/>

 

Enjoy !!!

 

Advertisements

Leave a comment

Filed under MS CRM 4.0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s