Usually when one thinks of populating a control like a ListBox with sequential numbers, the first thing that comes to a developers mind is to use a for loop. However with the LINQ Range Operator, generating a sequence of number is quite simple.
Let us see how to use the LINQ Range Operator to populate an ASP.NET ListBox with a Sequence of Numbers.
As you can see, just a line of code and your ListBox is populated with a sequence of numbers from 1 to 30
Will you give this article a +1 ? Thanks in advance