mobileNavlogo
headerlogo

SilverLight LINQ Integration

22 October, 2020

Ratings

Related Blogs

 

Linq queries are used to filtering the data and formatting the data. The Microsoft introduced linq concept in the 3.0 .net framework, the linq queries designed based on anonymous variables and generic classes As per .net technologies ‘var’ is an anonymous data type, in the anonymous variables we can maintain value format data and reference format data. The linq queries we can inherit to the ‘object,’ ‘ADO. net’ and “XML”

Example of Silverlight linq Integration

(Retaining greater than 5 array elements from the ArrayList) Open new Silverlight application

  • Add list box and button control
  • Go to the button click event

Private void button:-

click (object sender, routed Event agrs e)

{

Int [] a = {1,5,8,3,6,9,4,22,25,2,7};

Var x = from I in a where  i> 5 select I ;

For each (var v in x) { List box1. Items. Add (v. tostring ());

}

}

Formatting string array elements

Open new Silverlight application Add Listbox and button control Go to the button click event

Private void button 1_

click (object sender, routed event arge e)

{

String [] x = { “asd”, “zkd”, “poi”, “aad”, “tyu”, “klm:};

Var str = from I in x order by I as ceding select I ;

Foreach (var v in str)

{

list box 1.items add (v.to string ());

}

}
About Author
Authorlogo
Name

TekSlate

Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .