Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 17th, 2006, 09:45 PM
Authorized User
 
Join Date: May 2006
Location: , , .
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

  #2 (permalink)  
Old July 18th, 2006, 01:24 AM
Authorized User
 
Join Date: May 2006
Location: , , .
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.

  #3 (permalink)  
Old July 18th, 2006, 03:30 AM
Authorized User
 
Join Date: May 2006
Location: , , .
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

  #4 (permalink)  
Old July 18th, 2006, 11:20 AM
Authorized User
 
Join Date: May 2006
Location: , , .
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.

  #5 (permalink)  
Old July 19th, 2006, 03:07 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks once again MythicalMe, you have been very helpful.


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:47 PM.


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