求助,,这个错误怎么改啊啊,建立与服务器的连接时出错
建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
源错误:
行 33: //不存在,新建并打开
行 34: Connection = new SqlConnection(ConnectionString);
行 35: Connection.Open();
行 36: }
行 37: else
源文件: e:\设计网站\OnLineExam\App_Code\DataBaseClass\DataBase.cs 行: 35
堆栈跟踪:
[SqlException (0x80131904): 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
OnLineExam.DataBaseClass.DataBase.Open() in e:\设计网站\OnLineExam\App_Code\DataBaseClass\DataBase.cs:35
OnLineExam.DataBaseClass.DataBase.CreateStrCommand(String StrName, SqlParameter[] Prams) in e:\设计网站\OnLineExam\App_Code\DataBaseClass\DataBase.cs:174
OnLineExam.DataBaseClass.DataBase.RunStrGetReader(String StrName, SqlParameter[] Params) in e:\设计网站\OnLineExam\App_Code\DataBaseClass\DataBase.cs:316
OnLineExam.BusinessClass.Usersmr.CheckPassword(String XUserID) in e:\设计网站\OnLineExam\App_Code\BusinessClass\Usersmr.cs:203
Web_Login.imgBtnLogin_Click(Object sender, ImageClickEventArgs e) in e:\设计网站\OnLineExam\Web\Login.aspx.cs:47
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5087
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1879 --------------------编程问答-------------------- 不是改的问题,你先检查网络问题,然后是连接字符串是否写对了,服务器是让你访问等等 --------------------编程问答-------------------- 有可能是配置的问题吧,先尝试作下面的配置:
打开SQL Server 2005配置管理器(SQL Server Configuration Manager),在网络配置中,如果你是通过IP地址访问,要启用TCP/IP协议,如果通过命名实例访问,则要把Named Pipes协议启用。最好都启用吧。
还有外围配置的应用,可以参考这里
如果你的设置没有问题,服务也运行正常的话,就要检查网络,连接字符串等这一块了。 --------------------编程问答--------------------
设置允许远程连接
http://topic.csdn.net/u/20090930/23/48ee4a9e-e3b8-47a2-a5b2-ed74cf712778.html --------------------编程问答-------------------- 这个我都设置好了,可是还不行,你能帮我看一下嘛?我QQ840665174 --------------------编程问答-------------------- 还不行,你能帮我看一下嘛?我QQ840665174 --------------------编程问答-------------------- 源文件: e:\设计网站\OnLineExam\App_Code\DataBaseClass\DataBase.cs 行: 35
????????这是你网站的路径??居然有中文??????? --------------------编程问答-------------------- 啊啊,不可以用中文吗? --------------------编程问答-------------------- XP 系统 VS2008 Sql sever 2005 --------------------编程问答-------------------- WEB.CONFIG
</appSettings>
<connectionStrings>
<add name="mrOnLineExamConnectionString" connectionString="Data Source=WIN-K4VB106AG0A\FDW;Initial Catalog=mrOnLineExam;User ID=sa"
providerName="System.Data.SqlClient" />
<add name="mrOnLineExamConnectionString2" connectionString="Data Source=WIN-K4VB106AG0A\FDW;Initial Catalog=mrOnLineExam;User ID=sa"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
补充:.NET技术 , ASP.NET