| | |
Deleting Items from a table with relationships
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 38
Reputation:
Solved Threads: 1
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.
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
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 137
ASP.NET Syntax (Toggle Plain Text)
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
www.houseshark.net
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Image Upload in Ajax
- Next Thread: converting binary data into image in asp.net(vb code)
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox menu mouse mssql nameisnotdeclared news novell numerical opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl






