星空网 > 软件开发 > ASP.net

When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.

在调试SignalR程序时,提示一个异常:When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.

解决方法是在Global.asax.cs文件中Application_Start()和Application_End()方法中添加下面高亮代码:
When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.

 

When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Web.Routing;using Insus.NET.DataBases;using System.Data.SqlClient;namespace Insus.NET{  public class MvcApplication : System.Web.HttpApplication  {    protected void Application_Start()    {      AreaRegistration.RegisterAllAreas();      RouteConfig.RegisterRoutes(RouteTable.Routes);      SqlDependency.Start(DB.ConnectionString);    }    protected void Application_End()    {      SqlDependency.Stop(DB.ConnectionString);    }  }}

Source Code

 




原标题:When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.

关键词:sql

sql
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

外贸人必读!关于人民币汇率的那些事儿:https://www.ikjzd.com/articles/104390
搞懂亚马逊跟卖原理,你就读懂了姐夫搞跟卖的初衷!:https://www.ikjzd.com/articles/104392
这些八月外贸新政,你都知道吗?:https://www.ikjzd.com/articles/104393
FBA轻小计划在亚马逊运营中有什么作用?:https://www.ikjzd.com/articles/104394
冗余库存可做慈善!亚马逊FBA捐赠计划9月1日生效!:https://www.ikjzd.com/articles/104395
想要新店新品销量破零?你需要掌握关键词30X1.2原则:https://www.ikjzd.com/articles/104397
桂林酒店销售多少钱 桂林旅游宾馆价格:https://www.vstour.cn/a/410227.html
十里银滩旅游攻略玩什么住哪里怎么去?:https://www.vstour.cn/a/410228.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流