诡异的数据库连接问题

ishowing 2007-04-14 11:49:32
小弟参加一个人网页设计比赛,采用SQL Server2005+asp.net2.0。在自己的环境上运行没有问题,临时演示的时候问朋友借了个笔记本,重新安装系统和环境,然后通过分离-附加的方式把数据库移植到笔记本上,然后将.net程序也弄到笔记本上。
在执行数据操作的地方页面就显示不了,报错如下:
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.

请问这是哪里的问题呢?
PS:企业管理器的设置和本机上完全一样。数据库连接字符串也没问题。
...全文
199 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
ishowing 2007-04-15
  • 打赏
  • 举报
回复
已经是混合登陆了~~
新装的系统,只用来演示,只装了SQL Server2005、IIS、.net Framework2.0,其他什么软件都还没装。
babyrockxray 2007-04-15
  • 打赏
  • 举报
回复
是不是没有启动混合登录方式?或者有防火墙
ishowing 2007-04-15
  • 打赏
  • 举报
回复
用windows身份验证也不行~~
tcp/ip和共享内存是在哪里改呢?
ishowing 2007-04-15
  • 打赏
  • 举报
回复
如果用其他类型数据库的话服务器不一定支持啊!
选择SQL Server 2005也是逼不得以的事情噻~~
  • 打赏
  • 举报
回复
asp.net普通的应用应该使用免维护、免DBA安装和管理的嵌入数据库,不要使用c/s数据库。
  • 打赏
  • 举报
回复
你可以在dos下使用telnet、osql等先测试一下数据库是否可以访问。


自从当初 SQL Server 嵌入版故意在asp.net下产生异常,不让用,我就放弃Sql Server了,我当时第一个选择是使用 SQLite(http://www.sqlite.com.cn/MySqlite/3/375.Html)。

道理很简单,既然桌面应用和移动应用允许使用Sql ,为什么要限制asp.net使用呢。纯粹是搞技术的人才会想出来的歪招,搞技术的人往往不顾信誉,只好放弃。
ishowing 2007-04-15
  • 打赏
  • 举报
回复
up
fphuang 2007-04-14
  • 打赏
  • 举报
回复
看看sql配置中
协议部分的 tcp/ip和共享内存 是否都启用了
如果实在不好用,就改用windows验证连接吧
ishowing 2007-04-14
  • 打赏
  • 举报
回复
再PS:
更详细的报错我借了张图:
http://www.tangyong.net/err.jpg

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧