Deleting Items from a table with relationships

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2007
Posts: 38
Reputation: matale is an unknown quantity at this point 
Solved Threads: 1
matale matale is offline Offline
Light Poster

Deleting Items from a table with relationships

 
0
  #1
Sep 5th, 2008
Hello,
I have a Categories Table and a Products Table each product has a CategoryID which joins it to the Categories Table.
I have a gridView in which I want to enable adding deleting Catagories, how do I check if a category has Products in it, before attempting to delete it?
I hope that makes some sort of sense.
My current Project www.footystat.com
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Deleting Items from a table with relationships

 
0
  #2
Sep 8th, 2008
  1. select * from products where categoryid = ?

the other option is to set an active field, which could be a boolean column and set it to true or false, then select from 'active' columns only if you wanted to do updates rather than physical deletes
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC