LINQ - Using Where Sample
Following sample illustrate how to use Where in LINQ
---------------------------------------------
using System.Linq;
using System.Collections;
ArrayList objArryList = new ArrayList();
objArryList.Add(1);
objArryList.Add(22);
objArryList.Add(33);
objArryList.Add(14);
//Convert from ArrayList to Array
int[] arrNumbers = (int[])objArryList.ToArray(typeof(int));
//display values <15
var lowNums =
from n in arrNumbers
where n < 15
select n;
foreach (var x in lowNums)
{
MessageBox.Show (x.ToString());
}
Subscribe to:
Post Comments (Atom)
Open default email app in .NET MAUI
Sample Code: if (Email.Default.IsComposeSupported) { string subject = "Hello!"; string body = "Excellent!"; ...
-
HttpClient is a .NET class that an app can use to send HTTP requests and receive HTTP responses from a REST web service. The resources that...
-
Grid is a layout panel that consists of rows and columns. Example 1: < Grid > < Grid.RowDefinitions > < Row...
-
Label tb = new Label (); tb.Name = "LabelID" + iRow; tb.Content = lblName; Grid .SetColumn(tb, iCol); Grid .SetRow(tb,...
No comments:
Post a Comment