On 28.7.2006 15:52 Le roy Arnaud wrote:
> Hello ,
>
> a little question how i cant catch post_event with fbprovider, i think
> it's with fbremoteevent but i'm not sure anybody can confirm ?
>
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);
}
--
Jiri Cincura
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider