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) 
这是提示错误,为什么提示连接SQL2005,可我根本没装SQL2005啊,我是在本地用VS2005+sql2000开发的,服务器上没装VS2005,但装了Framewrok2.0+sql2000,这是为什么啊?

解决方案 »

  1.   

    开始->所有程序->Ms Sql Server->配置工具->sql server外围应用配置器->服务和连接的外围应用配置器->打开MSSQLSERVER节点下的Database Engine 节点,先择"远程连接",接下建议选择"同时使用TCP/IP和named pipes",确定后,重启数据库服务就可以了.
      

  2.   

    在你装VS2005的时候 它会捆绑安装SQL2005的可能是你没有把2005钩掉吧 。一旦你装了VS2005
    Framewrok2.0是肯定会安装的啊,vs2005的环境就是在Framewrok2.0下的,不过建议你安装sql2005我觉得比2000好用多了哦~
      

  3.   

    配置工具在MS SQL2005里,可服务器里没有MSSQL2005,只有2000,没有"配置工具"啊
      

  4.   

    <connectionStrings>
      <add name="IaskCaptureConnectionString" connectionString="Data Source=127.0.0.1;Initial Catalog=Capture;User ID=sa;Password=11111"
       providerName="System.Data.SqlClient" />
     </connectionStrings>
    连接字符串
      

  5.   

    本地没问题 更是说明你的链接字串给的不对么
    因为你本地有SQLSERVER2005 所以没问题
      

  6.   

    <appSettings>
       <add key="IaskCaptureConnectionString"  value="server=(local);uid=sa;pwd=11111;database=Capture"/>
      </appSettings>
    换成这个也不行啊,提示的错误是一样的
      

  7.   

    我今天终于解决了上述问题。  
    SqlConnection MyConnection = new SqlConnection(XXX);
    XXX的内容填写为  
    双击数据库,将数据库属性中connection string属性中的字符串替代 XXX
    然后将上面的每个/前再加一个/。然后注意把该删除的“删除就好了
    例如:
    SqlConnection MyConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Documents and Settings\\comiscience\\My Documents\\Visual Studio 2005\\Projects\\websiteTests\\WebSite4\\App_Data\\Database.mdf;Integrated Security=True;User Instance=True");