Using the adapter to fire some SQL... is it possible?

Posts   
 
    
Posts: 497
Joined: 08-Apr-2004
# Posted on: 30-Apr-2007 14:54:10   

Hi,

I have some LLBLGen code inserts some rows into a new table. This table currently contains a trigger that is getting in the way for me, so I want to temporarily disable the trigger, do the update, then re-enable the trigger. So, I need to fire this SQL against the database:

ALTER TABLE tablename DISABLE TRIGGER ALL

Can I do this within the adapter object somehow? I'm sure I remember Frans saying ages ago this is possible....

BTW I'm on the latest 2.0 code!

Thanks!

Matt

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 30-Apr-2007 15:26:09   

Hi,

Maybe you can have a look to DataAccessAdapterBase.ExecuteActionQuery method.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 01-May-2007 11:07:08   

Indeed, you could use that method. First open the connection manually on the adapter, then execute your query, set KeepConnectionOpen to true, run your updates, and then close the connection manually again.

Frans Bouma | Lead developer LLBLGen Pro