为什么我得到 No connection could be made because the target machine actively refused it
why do i get No connection could be made because the target machine actively refused it
我在我的 MVC 应用程序中使用 WCF 服务,我遇到这个问题是因为我有一台新计算机安装了新的 sql 服务器。我正在尝试调整我的 Web.Config 以匹配我的新 sql 实例。
我不确定为什么我得到无法建立连接,因为目标机器积极拒绝它。但我认为这与我的 ConnectionString 源可能不正确有关。我试过使用“。”还有“(本地)”,但它似乎不起作用。
连接字符串示例
<connectionStrings>
<add name="InventoryManagerEntities" connectionString="metadata=res://*/InventoryManagerModel.csdl|res://*/InventoryManagerModel.ssdl|res://*/InventoryManagerModel.msl;provider=System.Data.SqlClient;provider connection string="data source=(local);initial catalog=InventoryManager;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
Sql 服务器
答案是连接字符串问题,而不是只使用“.”。我不得不只使用我的机器名而不使用帐户名。
我在我的 MVC 应用程序中使用 WCF 服务,我遇到这个问题是因为我有一台新计算机安装了新的 sql 服务器。我正在尝试调整我的 Web.Config 以匹配我的新 sql 实例。
我不确定为什么我得到无法建立连接,因为目标机器积极拒绝它。但我认为这与我的 ConnectionString 源可能不正确有关。我试过使用“。”还有“(本地)”,但它似乎不起作用。
连接字符串示例
<connectionStrings>
<add name="InventoryManagerEntities" connectionString="metadata=res://*/InventoryManagerModel.csdl|res://*/InventoryManagerModel.ssdl|res://*/InventoryManagerModel.msl;provider=System.Data.SqlClient;provider connection string="data source=(local);initial catalog=InventoryManager;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
Sql 服务器
答案是连接字符串问题,而不是只使用“.”。我不得不只使用我的机器名而不使用帐户名。