Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Hello
When i expert a report in excel it gives me this errror: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

It is so strange to me, the report itself is fine, it works with my old database, but recently i upgraded to a cloud solution and it gave the above error. All other reports work but this.

Any suggestion?
shpresaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zephyr_hex (Megan)DeveloperCommented:
How is the report export being done?
Fernando SotoRetiredCommented:
All that error message is stating is that the collection you are accessing with the index is less then 0 which is not valid because a list only has positive index starting at 0 or the index you are using is greater then the number of elements in the collection which is invalid because the last index is one less then the total number of elements in the collection because collections are zero based index.

Can you post the code where this is happening please.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shpresaAuthor Commented:
I understand,
to me what makes it more weird is the the same code works fine when connected to my old database, the error does not show, once i connect it to the new database which it should be identical, the error shows up. It sounds to me that something within the database is bothering it. I have a lots of coding on this as it involves a whole report but I will and see if i can find anything within the database. Thanks
shpresaAuthor Commented:
Apperently i had done a chance on the database that effected it. I had reduced a value, or taken a row down. Thanks.
Fernando SotoRetiredCommented:
Not a problem shpresa, glad to help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.