Dearest,

I had already tried this option. I should have put in the email. Does not work 
because the "RemoteEventCounts" does not exist for Visual Basic. There is the 
"RemoteEventId as Integer" option. I am, in this reasoning, be possible to 
monitor events, but in a different form of language C#, with the handler of 
Visual Basic events.

Again, can you help me? Thank U.

Paulo Cezar Altafin .·.
Cambé - Pr - Brasil

From: Gerdus van Zyl 
Sent: Wednesday, March 04, 2015 6:56 AM
To: For users and developers of the Firebird .NET providers 
Subject: Re: [Firebird-net-provider] Sample 3. Firebird events [v1.7] 
inhttp://www.firebirdsql.org/en/net-examples-of-use/

Just run the code through telerik code converter here: 
http://converter.telerik.com/


On Wed, Mar 4, 2015 at 3:06 AM, <altafi...@gmail.com> wrote:

  Hi, 

  The sample noted is writed in C# and work fine. I’m try in VS 2013 Desktop 
Express.

  To make it clear, I join it here...
  static void Main(string[] args)
  {

  FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
  cs.DataSource = "localhost";
  cs.Database = "employee.fdb";
  cs.UserID = "SYSDBA";
  cs.Password = "masterkey";
  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 = "INSERT INTO SALES (PO_NUMBER, CUST_NO, SALES_REP, ORDER_STATUS, 
" +

  "ORDER_DATE, SHIP_DATE, DATE_NEEDED, PAID, QTY_ORDERED, TOTAL_VALUE, " +
  "DISCOUNT, ITEM_TYPE) VALUES (@po_number, 1004, 11, 'new', " +
  "'1991-03-04 00:00:00', '1991-03-05 00:00:00', NULL, 'y', 10, 5000, " +
  "0.100000001490116, 'hardware');";

  FbCommand command = new FbCommand(sql, connection);
  command.Parameters.Add("@po_number", FbDbType.Char, 8);

  for (int i = 360; i < 365; i++)
  {

  command.Parameters[0].Value = "V91E0" + i.ToString();
  command.ExecuteNonQuery();

  }


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

  static void EventCounts(object sender, FbRemoteEventEventArgs args)
  {
  Console.WriteLine("Event {0} has {1} counts.", args.Name, args.Counts);
  }


  My need: A sample writer in Visual Basic .Net (VB.NET). Sameone can put a 
answer for me? Tanks a lot. 

  Paulo Cezar Altafin .·.
  Cambé - Pr - Brasil

  ------------------------------------------------------------------------------
  Dive into the World of Parallel Programming The Go Parallel Website, sponsored
  by Intel and developed in partnership with Slashdot Media, is your hub for all
  things parallel software development, from weekly thought leadership blogs to
  news, videos, case studies, tutorials and more. Take a look and join the
  conversation now. http://goparallel.sourceforge.net/
  _______________________________________________
  Firebird-net-provider mailing list
  Firebird-net-provider@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/firebird-net-provider





-- 

------------------------------------------------------------------------
Gerdus van Zyl

www.infireal.com



--------------------------------------------------------------------------------
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/ 


--------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to