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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.