Change Notification with Oracle Dependency in C#

后端 未结 2 1297
春和景丽
春和景丽 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();
    
    0 讨论(0)
  • 2021-01-21 03:18

    I found out the solution. Problem wasn't in edition of Oracle database, but in the version. Version of Oracle server was 11.2.0.2.0 and version of client was 11.2.0.3.0 and this little difference was causing the problem.

    So for the future, alway check the versions of client and server, when encountering similar problem.

    0 讨论(0)
提交回复
热议问题