VS2005下数据库连接的问题

yunsongzh 2007-03-29 11:50:55
我现在安装了VS2005,但数据库用的仍然是SQL Server2000,在程序中连接到数据库时发生如下错误:
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),

是不是在VS2005中不能用SQL Server2000,只能用SQL Server2005? 我还没装SQL Server2005.如果可以用SQL Server2000,我应该做哪些设置?
谢谢各位了!
...全文
163 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bitpolar 2007-03-29
  • 打赏
  • 举报
回复
VS2005连接SQL Server2000没任何问题
要不微软也太面了
洛阳老马 2007-03-29
  • 打赏
  • 举报
回复
不会不能连接的,我现在用的还是2000数据库。检验你的连接设置。要么是不是SQL Server2000服务未正常启动什么的?
XIEWH 2007-03-29
  • 打赏
  • 举报
回复
http://www.cnblogs.com/bullion/archive/2007/03/03/662905.html
sz709 2007-03-29
  • 打赏
  • 举报
回复
using System.Data.SqlClient;

private SqlConnection cn = new SqlConnection
("Server=.;database=NorthWind;uid=sa;pwd=xx");

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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