Click here to Skip to main content
15,879,326 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error in SQL Light Compact 4 Pin
Dave Kreskowiak23-Nov-20 5:58
mveDave Kreskowiak23-Nov-20 5:58 
Questioninteresting issue with SortedSet and ElementAt Pin
BillWoodruff22-Nov-20 18:59
professionalBillWoodruff22-Nov-20 18:59 
AnswerRe: interesting issue with SortedSet and ElementAt Pin
Sandeep Mewara22-Nov-20 20:06
mveSandeep Mewara22-Nov-20 20:06 
GeneralRe: interesting issue with SortedSet and ElementAt Pin
BillWoodruff22-Nov-20 22:19
professionalBillWoodruff22-Nov-20 22:19 
GeneralRe: interesting issue with SortedSet and ElementAt Pin
Sandeep Mewara22-Nov-20 22:38
mveSandeep Mewara22-Nov-20 22:38 
GeneralRe: interesting issue with SortedSet and ElementAt Pin
BillWoodruff22-Nov-20 22:46
professionalBillWoodruff22-Nov-20 22:46 
GeneralRe: interesting issue with SortedSet and ElementAt Pin
Sandeep Mewara22-Nov-20 22:51
mveSandeep Mewara22-Nov-20 22:51 
AnswerRe: interesting issue with SortedSet and ElementAt Pin
Richard Deeming22-Nov-20 22:15
mveRichard Deeming22-Nov-20 22:15 
SortedSet<T>[^] doesn't have a property called ElementAt.

The ElementAt[^] method is an extension method defined for all IEnumerable<T> instances. You'll need round parentheses to call it, rather than square brackets, and you'll need a using System.Linq; declaration at the top of your code file.

But in your example, it would be better to simply use a foreach loop instead. The ElementAt method has to create an enumerator and enumerate i elements of the set for each iteration of your for loop, whereas a foreach loop would only create a single enumerator and enumerate the set once.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: interesting issue with SortedSet and ElementAt Pin
BillWoodruff22-Nov-20 22:40
professionalBillWoodruff22-Nov-20 22:40 
GeneralRe: interesting issue with SortedSet and ElementAt Pin
Richard Deeming22-Nov-20 22:58
mveRichard Deeming22-Nov-20 22:58 
Questionneed some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
albasheer210019-Nov-20 18:09
albasheer210019-Nov-20 18:09 
Rant[REPOST] need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
Richard Deeming19-Nov-20 21:45
mveRichard Deeming19-Nov-20 21:45 
AnswerRe: need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
Gerry Schmitz20-Nov-20 6:04
mveGerry Schmitz20-Nov-20 6:04 
QuestionHelp with Docker Pin
pkfox18-Nov-20 20:30
professionalpkfox18-Nov-20 20:30 
AnswerRe: Help with Docker Pin
Gerry Schmitz19-Nov-20 4:26
mveGerry Schmitz19-Nov-20 4:26 
GeneralRe: Help with Docker Pin
pkfox19-Nov-20 4:28
professionalpkfox19-Nov-20 4:28 
GeneralRe: Help with Docker Pin
Pete O'Hanlon19-Nov-20 4:39
mvePete O'Hanlon19-Nov-20 4:39 
GeneralRe: Help with Docker Pin
pkfox19-Nov-20 6:49
professionalpkfox19-Nov-20 6:49 
QuestionHow to save DataGridView content? Pin
Alex Dunlop17-Nov-20 21:35
Alex Dunlop17-Nov-20 21:35 
AnswerRe: How to save DataGridView content? Pin
Richard Deeming17-Nov-20 21:39
mveRichard Deeming17-Nov-20 21:39 
AnswerRe: How to save DataGridView content? Pin
OriginalGriff17-Nov-20 21:49
mveOriginalGriff17-Nov-20 21:49 
GeneralRe: How to save DataGridView content? Pin
Alex Dunlop18-Nov-20 6:05
Alex Dunlop18-Nov-20 6:05 
GeneralRe: How to save DataGridView content? Pin
OriginalGriff18-Nov-20 6:21
mveOriginalGriff18-Nov-20 6:21 
GeneralRe: How to save DataGridView content? Pin
Alex Dunlop18-Nov-20 6:05
Alex Dunlop18-Nov-20 6:05 
GeneralRe: How to save DataGridView content? Pin
Mycroft Holmes18-Nov-20 11:14
professionalMycroft Holmes18-Nov-20 11:14 

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.