Aney Adventures Online
To understand your parents' love, you must raise children yourself.

LINQ to SQL Batch Updates/Deletes: Fix for 'Could not translate expression'

Sunday, 20 April 2008 23:10 by Terry Aney

I've found and posted a new fix in the code from my original post: Batch Updates and Deletes with LINQ to SQL.  I'm not sure of the etiquette for this sort of thing: new post (like I'm doing) or just a comment in the original post.  But since I did get a fair amount of hits to the article but minimal comments, people who may have downloaded the code wouldn't get an update notification and I want to be sure to make them aware of an issue/fix (assuming they are monitoring via a RSS feed).... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   C# | LINQ
Actions:   E-mail | Permalink | Comments (7) | Comment RSSRSS comment feed

LINQPad: Preview DELETE and UPDATE SQL before it executes

Friday, 18 April 2008 03:06 by Terry Aney

Like everyone else (or at least you should be), I use LINQPad throughout the day non-stop.  Primarily for database maintenance that would have previously been done by saving a *.sql script.  However, at first when I was new to LINQ (not that I'm a complete expert now), I'd get hesitant when I was about to perform a bunch of updates and/or deletes against my production data.  Being more comfortable in Transact SQL than in LINQ, I wanted to see the SQL statements that would execute before actually calling SubmitChanges().  As plenty of posts have mentioned, it is far more than simply a LINQ to SQL execution tool, but rather:

And LINQPad is more than just a LINQ query tool: it's a code snippet IDE. Instantly execute any C# 3 or VB 9 expression or statement block!

- Joseph Albahari (creator of LINQPad)

With a couple of extension methods, you can do exactly that: preview the SQL before it executes.... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   Extension Methods | LINQ
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

I'm Four and Next I'll Be Five!

Tuesday, 15 April 2008 21:56 by Terry Aney

Harry Potter Birthday

So Josh has turned four and can't wait to turn five!  It was actually a great birthday.  For the Aney side, hands down the best present Josh got was his cousin Nick's hand me down Harry Potter blanket.  Every night I get a run down of everything on it when I cover Josh up.  It's almost as if he expects the blanket to magically change or something ;)  A huge thanks to Nick for that one - he thought of the present himself when he was told Josh was having a Harry Potter party with his friends.

So for Josh's first 'friend' birthday party, Uncle Tom was the hit of the party dusting off some of his old magic tricks to do a Harry Potter Magic Show.  Unfortunately, I discovered minutes before the show that my Camcorder was broken and I was relegated to trying to tape it on my regular digital camera.  However, the big problem was that the memory card kept filling up, so I'd run downstairs and copy it off quick and run back up and start recording.  So I missed a few tricks, but I missed the best one of all.... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   Joshua
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Providing a better source code preview in my posts

Monday, 14 April 2008 17:21 by Terry Aney

Based on a post by Troy Goode, I'm trying to find a better code preview output for my blogs.  Bear with me as this post is simply a test harness for finding a better code preview.... [More]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   BlogEngine.NET
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Batch Updates and Deletes with LINQ to SQL

Monday, 14 April 2008 04:07 by Terry Aney

A couple weeks ago, I read the article, LINQ to SQL Extension: Batch Deletion with Lambda Expression by Jeffrey Zhao.  In case you didn't read the article, it discusses the downside of most O/R Mapping frameworks when it comes to multiple updates or deletes.  He states the fact that a SQL statement for each row flagged as update/delete in the entity set is created.  I went about implementing something similar to what Jeffrey envisioned and I'll explain some of the hurdles I had to overcome to achieve it.... [More]

Currently rated 5.0 by 7 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   C# | Extension Methods | LINQ
Actions:   E-mail | Permalink | Comments (5) | Comment RSSRSS comment feed