Change Notification with Oracle Dependency in C#

后端 未结 2 1318
春和景丽
春和景丽 2021-01-21 02:26

I\'m trying to get oracle database change notification in c#. I found this tutorial about how to get these notifications. I\'ve also created simple win form application for cat

2条回答
  •  忘掉有多难
    2021-01-21 03:05

    Also you missed cmd.ExecuteNonQuery() in your code. Without executing of command this code will not work regardless of the version of the database.

    var cmd = new OracleCommand("select * from new_place", conn);
    conn.Open();
    cmd.AddRowid = true;
    var dep = new OracleDependency(cmd);
    dep.OnChange += new OnChangeEventHandler(dep_OnChange);
    cmd.ExecuteNonQuery();
    

提交回复
热议问题