今天下载了SQL Server 2005 Express和Visual Web Developer 2005 Express 来开发ASP.NET应用程序,数据库连接部分代码如下:
   SqlConnection conn = new SqlConnection();
   conn.ConnectionString = "server=xiaozu/SQLEXPRESS;database=northwind;integrated   security=yes";
   conn.Open();出现异常: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。  后来我也配置了“开始-程序-Server 2005 -配置工具-外围应用配置七-服务和连接的外围配置-实例-远程连接-允许”,重起了机子,还是出现同样的错误!高手们分析一下是什么原因???

解决方案 »

  1.   

    参考
    http://support.microsoft.com/?kbid=914277&SD=tech
      

  2.   

    最后写成./SQLEXPRESS
    面且05好像还没有northwind数据库
      

  3.   

    上面的连接是机器翻译的中文,下面是原文,应该可以解决你的问题
    http://support.microsoft.com/kb/914277/en-us
      

  4.   

    还是不行啊,我按照(http://support.microsoft.com/kb/914277/en-us)里面文章所说的,配置了Windows 防火墙,也关闭了第三方的防火墙,可还是出现同样的错误。(注:northwind数据库我是从微软上下载的)