tags:

views:

47

answers:

1

I am getting the following error on production server.It works well on localhost.

Error: Sequence contains more than one element

A: 

That is an InvalidOperationException thrown by the Single method.

This method is supposed to return only one element, and your query is returning more than one, you have to check the criteria you use on your query.

It will also throw an exception if it doesn't find an element.

CMS
why it works on localhost and not on production server?
Jignesh
I'm pretty sure that the data is different, and that's why with the same criteria you are getting the error only on production. I would recommend you to get a copy of the production database and check that query, try to debug and put a `Where` instead the `Single` so you will be able to see what are the rows that shouldn't be there.
CMS
Thanks.I will do that.
Jignesh