Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2006, 09:45 PM
Authorized User
 
Join Date: May 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Deleting Categories

Hi,
In Chapter 5, when a category is deleted through the website admin page, the related articles for that category are also deleted. I can't seem to find the code that deletes these articles, however. Am I missing something?

Cheers,
Simon

 
Old July 18th, 2006, 01:24 AM
Authorized User
 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

The articles are automatically deleted through SQL in a process known as cascading delete. When a relationship is set up between two tables an option can be specified to do a cascading update and/or delete. That means that anything that is requested to be done to the parent table is first cascaded to the child table(s). This can be very handy when you have a complicated database structure. Without cascading delete a table can have a child records that are orphaned and inaccessible.

 
Old July 18th, 2006, 03:30 AM
Authorized User
 
Join Date: May 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks MythicalMe, this helped me a lot and it's working on my website now, too.
I eventually found a reference to this on p.246 saying it is set up in the tables using database diagram. Is this the usual way of setting up cascading deletes? I haven't used them before.

Regards,
Simon

 
Old July 18th, 2006, 11:20 AM
Authorized User
 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

A stipulated yes. Anytime you can let SQL server take some of the workload your application is going to perform better, however, like most applications, it depends on the specific case. One time that you might not want to use cascading delete is when a child table has two or more parents.

 
Old July 19th, 2006, 03:07 AM
Authorized User
 
Join Date: May 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks once again MythicalMe, you have been very helpful.







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort categories using checkbox melvados Visual Basic 2005 Basics 2 August 5th, 2008 08:45 PM
Sub Categories for Forum- tectrix BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 9 May 21st, 2008 05:25 PM
Unlimited categories golden_drifter Access 2 August 31st, 2006 07:21 AM
Need help : how to query multiple categories will2kready SQL Language 0 January 10th, 2006 09:37 PM
Stand alone categories tree for OScommerce superdos PHP How-To 1 January 10th, 2006 07:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.