Friday, April 25, 2014

use Contains in LINQ using C#

var query6 = from n1 in names
 select n1.ToUpper() into n2
 where n1.Contains("a") // Illegal: n1 out of scope.
 select n2;
//rewrite query number 6
 var query10 = from n1 in names
 let n2 = n1.ToUpper()
 where n2.Contains("A")
 select n1;

No comments :

Post a Comment

AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath