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 Monday, January 26, 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

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

# Silverlight Cream for January 27, 2009 - 2 -- #499

Wednesday, January 28, 2009 12:30 AM by Community Blogs

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

# A Better Way to do Silverlight Databinding

Wednesday, February 04, 2009 12:40 AM by WebLog of Ken Cox

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

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

Wednesday, February 04, 2009 8:59 PM by Jimit

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

# Silverlight Travel » A Better Way to do Silverlight Databinding

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

Leave a Comment

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