예제 #1
0
파일: Program.cs 프로젝트: TataDvd/Git
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;
            try
            {
                FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
                cs.DataSource = "localhost";
                cs.Database   = @"E:\Samples\Tempo2012MVVM\Tempo2012\Tempo2012.UI.WPF\bin\Debug\data\TEMPO2012.fdb";
                cs.UserID     = "SYSDBA";
                cs.Password   = "******";
                cs.Charset    = "UTF8";

                connection = new FbConnection(cs.ToString());
                connection.Open();

                FbRemoteEvent revent = new FbRemoteEvent(connection);
                revent.AddEvents(new string[] { "acc_insert", "acc_update", });

                // Add callback to the Firebird events
                revent.RemoteEventCounts += new FbRemoteEventEventHandler(EventCounts);

                // Queue events
                revent.QueueEvents();

                Console.ReadLine();
                connection.Close();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
            }
        }
예제 #2
0
        public void InitConnection(string serverAddr)
        {
            _serverAddr = serverAddr;
            strConn     = "User=sysdba;Password=masterkey;Database=d:/anprdb/gbuanpr_geoje.fdb;Server=" + serverAddr + ";Port=3050";
            conn        = new FbConnection(strConn);
            conn.Open();
            fbEvent = new FbRemoteEvent(conn);
            fbEvent.AddEvents(new string[] { "item_inserted" });
            fbEvent.RemoteEventCounts += new EventHandler <FbRemoteEventEventArgs>(fbEvent_RemoteEventCounts);
            fbEvent.QueueEvents();

            dbReadThread = new Thread(DbReadThreadFunction);
        }
예제 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Inizini();
            FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

            cs.DataSource = "localhost";
            cs.Database   = "C:/trilogis/trilogis.fb20";
            cs.UserID     = userdb;
            cs.Password   = passdb;
            cs.Charset    = "NONE";
            FbConnection connection = new FbConnection(cs.ToString());

            connection.Open();
            FbRemoteEvent revent = new FbRemoteEvent(connection);

            revent.AddEvents(new string[] { "pronto" });
            revent.RemoteEventCounts += new FbRemoteEventEventHandler(EventCounts);
            revent.QueueEvents();
        }
예제 #4
0
    static void Main(string[] args)
    {
        FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

        cs.DataSource = "localhost";
        cs.Database   = @"TESTDATABASE.FDB";
        cs.UserID     = "SYSDBA";
        cs.Password   = "******";
        cs.Charset    = "NONE";
        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 = "EXECUTE BLOCK AS BEGIN POST_EVENT 'new_order'; END";

        FbCommand command = new FbCommand(sql, connection);

        for (int i = 0; i < 5; i++)
        {
            command.ExecuteNonQuery();
        }

        System.Threading.Thread.Sleep(2000);
        connection.Close();
        Console.ReadLine();
    }