我的计算机名WIN-WTYTCXLM8QP;Initial Catalog=OnLineExam;Persist Security Info=True;User ID=sa;Password=qaz7410" providerName="System.Data.SqlClient
这样配置可以吗,数据库为sql2008,实例名为mssqlsever,sa账户连接数据库成功,密码qaz7410
下面是原来的计算机配置
<connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=.\SqlExpress;Initial Catalog=OnLineExam;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>
    <add name="OnLineExamConnectionString1" connectionString="Data Source=(.\SqlExpress;Initial Catalog=OnLineExam;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>
    <add name="OnLineExamConnectionString" connectionString="Data Source=.\SqlExpress;Initial Catalog=OnLineExam;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>
  </connectionStrings>
请问要怎么改

解决方案 »

  1.   

    用户代码未处理 System.Data.SqlClient.SqlException
      Message="在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)"
      Source=".Net SqlClient Data Provider"
      ErrorCode=-2146232060
      Class=20
      LineNumber=0
      Number=-1
      Server=""
      State=0
      StackTrace:
           在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
           在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
           在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
           在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
           在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
           在 System.Data.SqlClient.SqlConnection.Open()
           在 OnLineExamDAL.UserService.LoginUser(String UserID, String pwd) 位置 C:\三层ASP.NET在线考试系统(SQL2005)OnLineExamSolution\codefans.net\OnLineExamSolution\OnLineExamDAL\UserService.cs:行号 240
           在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
           在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
           在 OnLineExamBLL.UserManager.Login(Users& user) 位置 C:\三层ASP.NET在线考试系统(SQL2005)OnLineExamSolution\codefans.net\OnLineExamSolution\OnLineExamBLL\UserManager.cs:行号 85
           在 _Default.imgBtnLogin_Click(Object sender, ImageClickEventArgs e) 位置 c:\三层ASP.NET在线考试系统(SQL2005)OnLineExamSolution\codefans.net\OnLineExamSolution\OnLineExam\Web\Login.aspx.cs:行号 40
           在 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
           在 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
           在 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
           在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
           在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
           在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
      InnerException: