943,793 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 518
  • ASP.NET RSS
Sep 5th, 2008
0

Deleting Items from a table with relationships

Expand Post »
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.
Reputation Points: 22
Solved Threads: 1
Light Poster
matale is offline Offline
38 posts
since May 2007
Sep 8th, 2008
0

Re: Deleting Items from a table with relationships

ASP.NET Syntax (Toggle Plain Text)
  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
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Image Upload in Ajax
Next Thread in ASP.NET Forum Timeline: converting binary data into image in asp.net(vb code)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC