Async and Await
http://blog.stephencleary.com/2012/02/async-and-await.html
[HowTo] Linq Pluralize
Sometimes Linq add or remove ‘s’ to the objecs, this is an option availlable in : Tools -> Options -> Database Tools -> O/R Designer
[HowTo] Remove Time from date in SQL
–The correct way (new since Sql Server 2008): cast(getdate() As Date) –The correct way (old): dateadd(dd, datediff(dd,0, getDate()), 0) –This is older now, but it’s still worth knowing because it can also easily adapt for other time points, like the first moment of the month, minute, hour, or year. –The fast way: cast(floor(cast(getdate() as float)) […]
Invoke Required… use MethodInvoker
if (dgvErrors.InvokeRequired) { dgvErrors.Invoke((MethodInvoker)delegate { SetError(ex, epr); }); } else { SetError(ex, epr); }
[HowTo] Display a separator on the status strip in a winform
Separator On Status Strip
[HowTo] Update Autogenerated values in Linq DBML
Set field properties in DBML editor : Auto-generated = true auto-sync = always More info here http://weblogs.asp.net/zeeshanhirani/…
[HowTo] disable “unknown publisher” security message on Windows Mobile device
http://xman892.blogspot.be/2007/07/visual-studio-2008-device-security.html
[HowTo] hide control in master page (asp.net)
http://stackoverflow.com/questions/3121915/can-i-hide-a-user-control-in-a-master-page-from-a-content-page
[HowTo] Select Top x using Linq
If you wish to make such a query : Select top 10 Foo from MyTable use the .Take(x) method : var foo = (from t in MyTable select t.Foo).Take(10); In VB LINQ has a take expression: Dim foo = From t In MyTable Take 10 Select t.Foo
[HowTo] Linq Count Granchild items from an object with .SelectMany()
Lets say you have the following structure : Product -> Zone -> Category -> Item Meaning a Product has multiple Zones with multiple Categories with multiple Items Lets say we need to select the count of items for each product in a simple distinct list of product. Linq query using .SelectMany() : xyzDataContext dc = […]