SqlDependency.Start();不支持的关键字:“元数据”

时间:2018-08-07 08:25:20

标签: global-asax sqldependency sqlcachedependency

我正在尝试SqlDependency进行我的申请。在Application_Start()方法的 global.asax 中,我正在编写以下代码:

string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["GmgHosEntities"].ConnectionString;'

System.Data.SqlClient.SqlDependency.Start(connectionString);

connectionString = "metadata=res://*/GmgHosModel.csdl|res://*/GmgHosModel.ssdl|res://*/GmgHosModel.msl;provider=System.Data.SqlClient;provider connection string=\"Data Source=HYTDEVSQL.gentest.hqtest.local;Persist Security Info=True;Initial Catalog=HAYAT;User ID=***;Password=***;MultipleActiveResultSets=True;Connection Timeout=180;application name=EntityFramework\""

给。但在这种情况下;

System.Data.SqlClient.SqlDependency.Start(connectionString);

我收到此错误:

Additional information: Keyword not supported: metadata.

我的web.config文件中的连接字符串          

我该如何解决?

0 个答案:

没有答案