“连接字符串指定本地Sql Server Express实例”,除非它不 [英] "The connection string specifies a local Sql Server Express instance", Except it Doesn't

查看:144
本文介绍了“连接字符串指定本地Sql Server Express实例”,除非它不的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用ApplicationServices成员数据库的SQL Server实例将asp.net应用程序部署到服务器。



问题是,我收到一条错误,说


连接字符串指定本地Sql Server Express实例
使用应用程序App_Data目录中的数据库位置


我收到此错误我最初试图用应用程序来部署 aspnetdb.mdf



当我报废时,我收到了这个错误该计划并决定执行 web.config 转换,以便在Debug中使用Express数据库,但在Release上,连接字符串将转到SQL Server。



当我确定好奇,从代码中删除所有对快速数据库的引用时,我再次收到这个错误,所以没有什么可以找到Express数据库。没有运气。



有没有人对此有任何想法?我每次都在IIS中删除并重新安装了这个网站,并注意到没有App_Data被部署,并且没有提到web.config中的.mdf文件没有效果。它仍然认为有一个连接字符串告诉它来查找SQL Server Express数据库:/



编辑这是我的连接字符串使用。数据源= HERP;初始化目录= DERP;集成安全性=$ True


解决方案

错误可能是指默认的连接字符串 machine.config 文件( LocalSqlServer )考虑到默认会员提供商使用此连接字符串,可能会发生这种情况



Machine.config文件[...]中配置了以下默认成员元素:



< membership>

< providers>

< add name =AspNetSqlMembershipProvider[...]

connectionStringName = LocalSqlServer[...]



I'm trying to deploy an asp.net application to a server using a SQL Server instance for the ApplicationServices membership database.

The problem is, I'm getting an error that says

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory

I got this error when I initially tried to deploy the aspnetdb.mdf itself with the application.

I got this error when I then scrapped that plan and decided to do a web.config transform so that in Debug I use the Express database, but on Release the connection string goes to SQL Server.

I got this error again when I decided out of curiosity to remove all references to the express database from the code, so there could be no possible way anything would be looking for the Express database. No luck.

Does anyone have any ideas about this? I have deleted and re-installed the web site in IIS each time, noting that there is no App_Data being deployed and no mention of the .mdf file in web.config - to no avail. It still thinks there's a connection string telling it to look for a SQL Server Express database :/

Edit: Here's the connection string I'm using. Pretty standard, I think, but I could always be wrong.

Data source=HERP;Initial Catalog=DERP;Integrated Security=True

解决方案

Could the error refer to the default connection string from the machine.config file (the LocalSqlServer one)? This could be happening, considering that the default membership provider uses this connection string:

The following default membership element is configured in the Machine.config file [...]:

<membership>
<providers>
<add name="AspNetSqlMembershipProvider" [...]
connectionStringName="LocalSqlServer" [...]

这篇关于“连接字符串指定本地Sql Server Express实例”,除非它不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆