下文中用Express代表"SQL Server 2005 Express Edition",用Enterprise代表"SQL Server 2005 Enterprise Edition"。1.如何实现最简单的发布?1.1我尝试最简单的XCOPY发布,也就是用VS2005那个“复制网站”的功能,把整个网站目录复制过去,运行时出现“无法连接到SQL Server”的错误。网站使用的ConnectionString是用于连接Express数据库的那种,也就是指定一个mdf数据库的物理路径并指定attach到哪个Express实例。服务器上的Enterprise安装使用的是默认配置,由默认安装方式的SQL Server 2000 Enterprise默认实例升级而来。1.2我也尝试过在服务器上再装一个SQL Server 2005 Express,实例名为SQLEXPRESS,也就是和XP上默认方式安装一个Express一样的实例名。这时候1.1上提到的XCOPY发布的网站能够连接到数据库,但是要更新数据库时报告“无法更新数据库”错误。既使我对App_Data目录及该mdf文件赋予了Network Service帐号的修改权限,还是“无法更新数据库”错误。2.把Express的mdf发布到仅有Enterprise的服务器上可以吗?(也就是1.2我所做的是必须的吗?)还是说必须装一个Express?3.如果可以直接把Express的mdf发布到仅有Enterprise的服务器上,可以继续以Express的形式运行吗?还是必须把mdf文件attach到Enterprise上面去,然后修改ConnectionString?4.如何动态创建一个Express方式运行的mdf数据库?(就像动态创建一个mdb那样。Express的随时attach数据库mdf文件的运行方式,就是用来取代mdb的吧。)
解决方案 »
- asp.net运行错误
- 文章浏览次数怎么设计好?
- 新手:gridview删除一行后,页面的显示不能自动刷新,老是存在已经删除过的行。
- 如何在第一个dropdownlist的基础上,对第二downlist的内容选择呢?
- viewstate是什么?及其参数?
- 200分求:vs2005对vs2003的新增功能???
- C#进行Post提交时,&连接符导致数据丢失问题
- vs 2003不能创建asp.net页面了,高手们进来看看!!!
- 请问如何将SQL SERVER数据库中的图片导入DATAGRID并正常显示为图片,如何在企业管理器中知道图片字段(二进制)是否为空,因为空与不空im
- dropdownlist做登陆时查询在职的绑定到dropdownlist中选择的和实际不一致
- 这个SQL语句有没有错误?
- 求基于 ORMapping 框架的源码
连接问题可以看看这个
http://ghd258.cnblogs.com/archive/2006/02/20/333777.html
在Enterprise上随便建一个库,连通了再说。
这个错误只会出现在数据库连接失败或者登陆失败的情况。
.NET Framework 2.0下这个错误是:
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)
1:SQL Server 2000 企业管理器好象不支持连接了。会提示使用SQL Server ManageMent sutdio 或者SQL Server 管理对象(SMO)只能通过查询分析器连接SQL Server 2005注意事项:A:检查SQL Server 2005 1433端口是否打开。
数据库服务器操作如下:开始->Microfoft SQL server 2005->配置工具->SQL Server Configuration Manager->
SQL Server 2005 网络配置->MSSQLSERVER 的协议B:Windows xp/2003 Server 网络连接会安装放火墙,必须关闭,方法如下:
双击网络连接->属性->高级->windows 放火墙->设置->例外->添加端口->(如数据库: 1433)->确定->确定 即可--(SQL Server 2000客户端)即可通过查询分析器连接到SQL Server 2005
装dotnetfx2.0chs
装sqlexpress_chs把预先在自己机器上用VS2005开发的基于SqlExpress的WEB工程Publish了,然后拷贝到服务器上在IIS下建立站点怎么就不行呢?
还必须安装SqlServer2005么?那我还要Express干什么?
--------------------------------------------------------------------------------An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
<add name="SqlServices" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|ASPNETDB.mdf;User Instance=true"/>
</connectionStrings><membership defaultProvider="AspNetSqlProvider">
<providers>
<add name="AspNetSqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
/>
</providers>
</membership>在这两种配置时,通过站点管理添加用户,可以添加同名用户。然后打开ASPNETDB.mdf看aspnet_Users表,看到确实有两个同名用户,不过ApplicationId不同。还有就是,我停止了SQL Server服务,这时候用第一种方法马上就提示不能连接数据库了,但是用第二种方法仍然能够读取数据,但总是“无法更新数据库”(即使给App_Data目录Everyone的完全控制权限)。