Browse by Tags

All Tags » LINQ (RSS)

LINQ and Homework

My daughter asked me to check her homework today.  One of the math problems was: A book has 352 pages.  How many 4's were used to print all of the page numbers. She got 35.  She explained how she arrived at that number and while her logic...
Posted by PSteele | 14 comment(s)
Filed under: ,

LINQ2SQL: SubmitChanges() doesn't do anything?

Dear Linq2SQL, I'm sorry.  It was a mistake.  I was just doing a simple demo and forgot to define the primary key on a table.  You were so nice to generate my class definitions for me without complaining.  You queried the data and...
Posted by PSteele | 4 comment(s)
Filed under: ,

Comparing Two Arrays

I was looking at some old code today that was checking if two byte arrays had the same data in them.  It was a simple loop that compared each element.  I recalled my blog post from November of last year about comparing collections/arrays in...
Posted by PSteele | 6 comment(s)
Filed under: ,

LINQ: Quickly Create Dictionaries with ToDictionary

Donn Felker recently blogged about a neat little extension method in LINQ called Any() .  If you simply want to know if a sequence contains any elements, many people use ".Count() > 0" which will walk the entire sequence to compute the...
Posted by PSteele | 1 comment(s)
Filed under: ,
More Posts