I tried the folowing code: ////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using FirebirdSql.Data; using FirebirdSql.Data.FirebirdClient; namespace WindowsApplication4 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { FbConnectionStringBuilder cs = new FbConnectionStringBuilder(); cs.DataSource = "localhost"; cs.Database = "C:\\Program Files\\OroLogic\\NewWayService2\\NWS.IB"; cs.UserID = "SYSDBA"; cs.Password = "TopSecret"; cs.Pooling = false; FbConnection connection = new FbConnection(cs.ToString()); connection.Open(); FbRemoteEvent revent = new FbRemoteEvent(connection); revent.AddEvents(new string[] { "NEW_ORDER" }); // Add callback to the Firebird events revent.RemoteEventCounts += new FbRemoteEventEventHandler(EventCounts); // Queue events revent.QueueEvents(); string sql = "INSERT INTO Z_WEB_USER (NAME, PASS, Z_WEB_USER_GROUP_ID) VALUES ('Testing5','Password','1')"; FbCommand command = new FbCommand(sql, connection); command.ExecuteNonQuery(); connection.Close(); } static void EventCounts(object sender, FbRemoteEventEventArgs args) { Console.WriteLine("Event {0} has {1} counts.", args.Name, args.Counts); } } } /////////////////////////////////////////////////////// The void EventCounts does not fire. I do not understand this construction. How should it work? By the way the update on the table is done by a third party application. I'm just interested in how to catch this event. ------- Original Message ------- >From : Jiri Cincura[mailto:[EMAIL PROTECTED] Sent : 6/15/2006 8:35:02 AM To : firebird-net-provider@lists.sourceforge.net Cc : Subject : RE: Re: [Firebird-net-provider] Event/trigger? On 15.6.2006 9:10 Wilko Stalknecht wrote: > How can i catch an event or trigger in .net? > After update of a record in an table i need to generate an e-mail. I was > thinking of creating a service thats reacting on a trigger. > any example in vb.net or c# are welcome. Catching trigger doesn't make sense. The example with event you can find on http://www.firebirdsql.org/index.php?op=devel&sub=netprovider&id=examples#3 -- Jiri Cincura http://blog.vyvojar.cz/jirka/ | http://photo.cincura.net/ _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider