Silverlight 2 Data Form - Episode 5: "D" is for Delete

In software development, learning the 'easy' stuff is a breeze. Pick up most any book or article, or browse to the online help and blogs. It's the hard stuff that authors and bloggers ignore or gloss over, at least in the first edition. It's not difficult to understand why; figuring out complicated tasks requires time-consuming questions, lots of research, and plain ol' trial and error. Deadlines crush the best intentions.

That was my observation when I wanted to know how to delete a customer from the famous Northwind database using VB, Silverlight 2, Entity Framework, and ADO.NET Data Services. I couldn't find anyone who had done it, so I barged ahead myself. As you discover, asynchronous data calls force you through a lot of hoops (and loops!) to achieve cascading deletes. The foreign key constraints are what get you.

I suppose I could have taken the nice, easy route and assumed that the user could implement a SQL stored procedure to handle the chore. However, as Tina Turner announced in Proud Mary, "You see, we never ever do nothing nice and easy. We always do it nice and rough."

Episode 5: "D" is for Delete probes data associations, properties and links in the Entity Framework. It takes you step by step through the code to delete a customer, the customer's orders, and the order details. I hope you find it worthwhile.

Make sure you've worked through Episode 1, Episode 2, Episode 3, and Episode 4 first. Without them, you won't have the prerequisite code or project infrastructure to succeed in this episode.


 

Published 26 January 2009 10:07 PM by Ken Cox [MVP]
Filed under: ,

Comments

# Silverlight 2 Data Form - Episode 5: "D" is for Delete - WebLog of Ken Cox said on 27 January, 2009 01:50 AM

Pingback from  Silverlight 2 Data Form - Episode 5: "D" is for Delete - WebLog of Ken Cox

# Community Blogs said on 28 January, 2009 12:30 AM

In this issue: Thiago Felix, Thomas Kirchmair, Ken Cox, Jeff Paries, Daniel Crenna, Bryant Likes, Mike

# WebLog of Ken Cox said on 04 February, 2009 12:40 AM

The guys at Intersoft Solutions are ahead of the curve again with their Intersoft Data Source control

# Jimit said on 04 February, 2009 08:59 PM

This is a great series. Would be possible to provide downloadable source code however?

# Silverlight Travel » A Better Way to do Silverlight Databinding said on 05 February, 2009 01:17 AM

Pingback from  Silverlight Travel » A Better Way to do Silverlight Databinding

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Search

Go

This Blog

Web Links

Syndication