Convert SQL to Linq
Was looking to convert a complex SQL query and short on time, so came across this nifty little tool to automate the conversion! It even outputs and autobuilds necessary classes! At the time of this...
View ArticleOrderBy Column Name as String using Linq C# .Net Dynamic Sorting of Anonymous...
If you’re familiar with Linq, you have undoubtedly used the popular “OrderBy” extension method. Unfortunately, this method does not accept a string value with the column name. var data = from i in...
View ArticleC# ListBox Management Adding Removing Updating Databound Items ASP .Net
The lambda one-liner indicated in the snippet below essentially nests at least two “for/foreach” loops. See my related article for full source. This code snippet is used to populate a drop down list of...
View ArticleMultiple Stored Procedures with same return type in LINQ
Previously you may have achieved this functionality using datareader. Now that you are using LINQ, you may be wondering how to achieve the same with lists of strongly typed objects. Quite a few...
View Articlelinq to csv extension method
Can be used to convert list of strongly typed objects to csv output. public static class extensionmethods { #region LinqToCSV public static string ToCsv<T>(this IEnumerable<T> items) where...
View Articlec# .net split strings with math divrem using lambda linq
Recently I came across a nice alternative to loops using linq for evenly splitting a string using Math.DivRem. The following example illustrates how this can be used to parse a sequence of numbers...
View Article