我正在部署到 IIS 6.0,这不是一项简单的任务。我终于设法连接到数据库(SQLServer 2005),但仅限于登录(ASP.NET 成员资格)。一旦我尝试单击另一个安全页面,数据库连接就会自动消失。这是次要问题。
这是我的错误信息:
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +166
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
DataAccess.IntranetTableAdapters.user_in_rolesTableAdapter.GetUsersInRoles() in C:\Users\me\Dropbox\Projects\MS\customer\DataAccess\CustomerIntranet.Designer.cs:2407
BusinessClasses.RoleProvider.GetRolesForUser(String username) in C:\Users\me\Dropbox\Projects\MS\customer\BusinessClasses\RoleProvider.cs:86
System.Web.Security.RolePrincipal.IsInRole(String role) +182
System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal) +132
System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb) +256
System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb) +201
System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) +8886509
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
特别是我正在查看这两行并想知道为什么我的本地计算机目录路径会出现在这个部署在远程服务器上的错误消息中。
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
DataAccess.IntranetTableAdapters.user_in_rolesTableAdapter.GetUsersInRoles() in C:\Users\me\Dropbox\Projects\MS\customer\DataAccess\CustomerIntranet.Designer.cs:2407
BusinessClasses.RoleProvider.GetRolesForUser(String username) in C:\Users\me\Dropbox\Projects\MS\customer\BusinessClasses\RoleProvider.cs:86
有人可以告诉我这些路径从哪里显示或为什么显示?重申一下,这些路径来自我创建应用程序的开发机器。错误消息正在远程服务器上显示(通过远程桌面连接)。
谢谢