未处理 System.Data.SqlClient.SqlException
  Message="在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)"
     我在做登录模块时出现这错误!请高手帮帮忙!我在做毕业设计! 我是菜鸟!!高手,说的详细一点,最好附上截图! 谢谢了!

解决方案 »

  1.   

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Data.SqlClient;namespace TestDb
    {
        class Conn
        {
            private string IP;
            private string DbName;
            private string DbUser;
            private string Key;        public Conn(string ip, string dbName, string dbUser, string key) 
            {
                IP = ip;
                DbName = dbName;
                DbUser = dbUser;
                Key = key;
            }
            public SqlConnection creatConn()
            { 
                SqlConnection thisConnection = new SqlConnection(@"Server="+IP+";user id="+DbUser+";initial catalog="+DbName+";password="+Key);
                thisConnection.Open();//运行到这是出错!
                return thisConnection;
            }
        }
    }
      

  2.   

    我的email : cczb1987(at)126.com qq:41676121二 请高手联系!