コード例 #1
0
        private void createTrigger_Click(object sender, EventArgs e)
        {
            var triggerHelper = new TriggerData(triggerNametxt.Text, referenceTable.SelectedItem.ToString(),
                                                whenCB.SelectedItem.ToString(), scriptTb.Text);

            triggerHelper.DefineActionTrigger(InsertCb.Checked, DeleteCb.Checked, UpdateCb.Checked);
            var sql = tManager.CreateQuery(triggerHelper);

            try
            {
                connection.ExecuteCommand(sql, new string[] { });
            }
            catch (SqlException error)
            {
                MessageBox.Show(error.Message);
                return;
            }

            MessageBox.Show("Query Executed Correctly!");
        }