Click here to Skip to main content
11,647,828 members (61,880 online)
Click here to Skip to main content

Tagged as

Sequence contains no elements

, 14 Jan 2010 CPOL 15.8K 1
Rate this:
Please Sign up or sign in to vote.
The error occurs when you try to access an object returned by a Linq query with 0 elements in the result set an InvalidOperationException is thrown. here is a simulation to generate the error and fix it: LINQ: Sequence contains no elements[^]
The error occurs when you try to access an object returned by a Linq query with 0 elements in the result set an InvalidOperationException is thrown. here is a simulation to generate the error and fix it: LINQ: Sequence contains no elements[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ali Tarhini
Software Developer (Senior) Microgen
Lebanon Lebanon
For more articles and extreme topics please check out my personal website www.alitarhini.com

You may also be interested in...

Comments and Discussions

 
QuestionStatus of hyperlink Pin
joshrduncan201221-Nov-13 9:10
memberjoshrduncan201221-Nov-13 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150804.4 | Last Updated 14 Jan 2010
Article Copyright 2010 by Ali Tarhini
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid