OnError Event

Occurs when an exception is throw during the change listening stage.

Syntax

public event ErrorEventHandler OnError;

Remarks

Once received this event, OracleTableDependency ends to work.

        static void Main()
        {
            using (var tableDependency = new OracleTableDependency<Customer>(
                ConnectionString, 
                TableName)
            {
                tableDependency.OnError += TableDependency_OnError;

                tableDependency.Start();
                Console.WriteLine("Waiting for notifications");
                Console.WriteLine("Press a key to exit");
                Console.ReadKey();
                tableDependency.Stop();
            }
        }

        static void TableDependency_OnError(object sender, ErrorEventArgs e)
        {
            Exception ex = e.Error;
        }


Last edited Sep 10, 2015 at 10:48 AM by delbianco, version 4