triggers

WPF Trigger binding to MVVM property

I have a datatemplate containing an image that I want to be hidden if the the value of a property in a ViewModel is true. Can anyone tell me why the the xaml below does not work? <Image x:Name="img" Source="..\Images\List_16.png" Margin="0,0,5,0"> <Image.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding ...

How to keep an audit/history of changes to the table

I've been asked to create a simple DataGrid-style application to edit a single table of a database, and that's easy enough. But part of the request is to create an audit trail of changes made, who made them, and the date/time. How might you solve this kind of thing? (I'll be using C# in VS2008, ADO.NET connected to SQL Server 2005, WPF...

PostgreSQL: UPDATE implies move across partitions

(Note: updated with adopted answer below.) For a PostgreSQL 8.1 (or later) partitioned table, how does one define an UPDATE trigger and procedure to "move" a record from one partition to the other, if the UPDATE implies a change to the constrained field that defines the partition segregation? For example, I've a table records partitio...

Is it possible to have a stateless timed function.

I'm trying to set a reminder in a system to fire at a certain time. This is a web based app, so it's not like it will be in memory all the time. Ideally I'd like to avoid using a service or job on the server(mainly out of curiosity, to see if there is a more efficient way to do it) For example, imagine how many Ebay bids are constantl...

How do I run event triggers and their bound methods synchronously using jQuery?

The function below is called upon page ready, and is designed to mimic clicks through various anchor links, and to trigger those anchors' bound methods so as to reproduce the same DOM that would be configured through manually clicking the same links. function useAnchor() { var uri = document.location.toString(); if (uri.match('#...

OptimisticConcurrencyException -- SQL 2008 R2 Instead of Insert Trigger with Entity Framework

Hi, Using a SQL 2008 R2 November release database and a .net 4.0 Beta 2 Azure worker role application. The worker role collects data and inserts it into a single SQL table with one identity column. Because there will likely be multiple instances of this worker role running, I created an Insert Instead Of trigger on the SQL table. The...

Transaction count exception in vb.net (SQL Exception)

I am getting below exception when i am going to enter record in a table through StoredProceduer of sqlserver i have a field which i need u update immediately after insert of new record in table. for that i created a sotredprocedure in which i wrote insert command first and after that i wrote a update command for same recored but it gave ...

Copy trigger from one database to another

Is it possible, in a script executed in MS SQL Server 2005, to copy a trigger from one database to another? I've been asked to write a test script for a trigger my project is using. Our test structure is to create an empty database containing only the object under test, then execute a script on that database that creates all the other o...

TabControl > TabItem.Header > Image Source with IsSelected Property

How do I change an image source within my TabControl > TabItem > TabItem.Header using triggers? Here's what I have so far: <TabControl Name="tabctlMainTab" Style="{StaticResource PrimaryTabControl}" SelectionChanged="MainTab_SelectionChanged" Background="Transparent"> <TabIte...

Oracle: How do I determine the NEW name of an object in an "AFTER ALTER" trigger?

Suppose I have an AFTER ALTER trigger on my Oracle database and I rename some database object (ALTER ... RENAME TO ...). Within the trigger, how do I determine the new name of the database object? It seems that the ORA_DICT_OBJ_OWNER, ORA_DICT_OBJ_NAME and ORA_DICT_OBJ_TYPE functions all return the old values of the database object. For...

Infinite Looping Trigger

I have an after update/insert trigger on table x. In this trigger I need to check if a certain column has been updated which is simple enough doing a deleted/inserted table comparison. However, if a certain column has been changed to a certain value I need to update the inserted row in table x. Doing so obviously creates a loop. The ...

Oracle Trigger Updating a field on an Insert or an Update

Hi all, For some reason i'm running a blank on how to go about doing something like this. I have a table that looks like this UserID | Name | DateAdded | LastUpated -------------------------------------------------- 1 | James Q | 1/1/2009 | If i insert or update record the lastupdated field should be updated the...

SQL Insert trigger to update INSERTED table values

Hello. I want to create an Insert trigger that updates values on all the inserted rows if they're null, the new values should be taken from a different table, according to another column in the inserted table. I tried: UPDATE INSERTED SET TheColumnToBeUpdated = ( SELECT TheValueCol FROM AnotherTable.ValueCol WHERE Another...

Bind FontWeight to a Boolean in Silverlight

Silverlight does not feature DataTriggers, so in this case... what might be the best way to conditionally set the fontweight of an item to a boolean? For example... the following is not possible in Silverlight. <TextBlock Text="{Binding Text}"> <TextBlock.Triggers> <DataTrigger Binding="{Binding IsDefault}" Value="True"> ...

MySql Triggers - Can a trigger stop ALL dml?

Hi All, Is it possible to create a trigger on a table that is initiated when ANY dml is performed on the table? For example -- I need to ensure that no insert/update/delete statements can be run on the weekend. So, instead of writing: CREATE TRIGGER DENY_DML_1 BEFORE INSERT... CREATE TRIGGER DENY_DML_2 BEFORE UPDATE... CREATE TRIGG...

Triggering upstream project builds before downstream project

I have the following project layout: WAR Project A Upstream Projects Dependency B Dependency C Dependency D I'm looking to setup A so that every time I want to trigger a build, it will first build B, C, and D. If either builds for B, C, or D fail then A's build should fail as well. It seems like a common build case, but I'm not...

Is it possible to insert data in MySQL from a SQL Server trigger?

A fun question for a Friday afternoon, no? As the question states, is it possible to write a SQL Server trigger that inserts data into a MySQL table? EDIT: Yes, I know this is basically a dumb idea and that the application should be doing it and so on. But this is a legacy Classic ASP application which we're transitioning to MySQL; a...

SQL Server 2000 Triggers

Using SQL Server 2000, I need to insert the deleted records from one table into a second table. What's the best way to achieve this using a SQL Server 2000 trigger? with thanks and regards Sathia ...

How bad is it to simulate IDENTITY/AUTOINCREMENT columns using triggers in Oracle?

I maintain an application that was originally written to be SQL Server-specific (using IDENTITY fields). Thus, we've had to define a lot of triggers to auto increment tables' primary keys. I'm told that this is considered to be a hacky workaround in the Oracle world, but that was told to me in a "friend of a friend" kind of way. How b...

triggers in new and old columns

Why can't we use :new and :old columns in a statement level trigger? ...