Click here to Skip to main content
12,242,175 members (56,894 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

18.6K views
1 bookmarked
Posted

Sequence contains no elements

, 14 Jan 2010 CPOL
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 10:10
memberjoshrduncan201221-Nov-13 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web01 | 2.8.160426.1 | Last Updated 14 Jan 2010
Article Copyright 2010 by Ali Tarhini
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid