我想使用OracleDependency + SignalR创建一个应用程序,请遵循文档并执行以下步骤:
在Oracle上激活此命令
grant change notification to SN_Hospitales;
GRANT EXECUTE ON DBMS_CHANGE_NOTIFICATION TO SN_Hospitales;
然后我在.Net上有了这段代码
var Entidad= "sn_hospitales.entidad_dependency";
var login = "DATA SOURCE=(DESCRIPTION = " +
" (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.54.170)(PORT = 1521)) " +
" (CONNECT_DATA = " +
" (SERVER = DEDICATED) " +
" (SERVICE_NAME = SERUD) " +
" )) ; USER ID=SN_Hospitales;PASSWORD=XXXXXX";
OracleConnection con = new OracleConnection(login);
con.Open();
OracleDependency dependency = new OracleDependency();
OracleCommand cmd = con.CreateCommand();
string sql = "select nombre from " + Entidad;
cmd.CommandText = sql;
dependency.OnChange += new OnChangeEventHandler(dep_OnChange);
dependency.AddCommandDependency(cmd);
cmd.Notification.IsNotifiedOnce = false;
cmd.AddRowid = true;
cmd.ExecuteNonQuery();
但是该应用程序无法正常工作,任何人都可以帮助我吗?