I've got the code below and when I run it, it always says there are 0 triggers in table.Triggers. I added some debugging code checkin the table.HasDeleteTrigger, etc. and from that, I get the exception:
"To accomplish this action, set property HasDeleteTrigger." when I try to set it to bool hasDeleteTrigger.
I can get stored procedures find, just not triggers.
Below is my problem code:
foreach (Database database in databaseCollection)
// first we need to delete triggers associated with all tables that begin
// with our prefix. we can skip our the framework tables because those
// don't have triggers on them
// grab all tables, filter for non prefixed ones in foreach loop so we can delete triggers from non prefixed ones
results.AddRange(from Table table in database.Tables
foreach (var tableName in results)
var table = new Table(database, tableName, CrSyncDbSchemaName);
bool hasDeleteTrigger = table.HasDeleteTrigger;
bool hasAfterTrigger = table.HasAfterTrigger;
bool hasInsertTrigger = table.HasInsertTrigger;
View Complete Post