Invoke Cascade Delete.

Posts   
 
    
Posts: 27
Joined: 27-Oct-2004
# Posted on: 27-Oct-2004 13:42:12   

Hello.

Using the Northwind SQL Database, I typed this code:

CategoryEntity E = new CategoryEntity ( 5 ) ; E.Delete() ;

I want to delete the Category ID 5 and all the products linked to it. I get an error. How can I do a cascade deletion just from calling E.Delete() ?

Regards.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 27-Oct-2004 13:48:45   

LuiguiPepino wrote:

Hello.

Using the Northwind SQL Database, I typed this code:

CategoryEntity E = new CategoryEntity ( 5 ) ; E.Delete() ;

I want to delete the Category ID 5 and all the products linked to it. I get an error. How can I do a cascade deletion just from calling E.Delete() ?

Cascading deletes are not implemented in the code, you have to OR do it manually, OR set it up in the database (you can activate cascading deletes on a relation in SqlServer)

Frans Bouma | Lead developer LLBLGen Pro