繁体   English   中英

ASP.Net错误26错误定位指定的服务器/实例

[英]ASP.Net Error 26 Error Locating Server/Instance Specified

我无法弄清楚我在做什么错。 我已经尝试了所有方法:我的连接字符串,关闭了防火墙,允许远程连接,但是我仍然不断收到此错误:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 服务器未找到或无法访问。 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26-指定服务器/实例时出错)

[SqlException(0x80131904):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 服务器未找到或无法访问。 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26-错误指定服务器/实例的位置)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔值breakConnection,操作1 wrapCloseInAction) +6568558 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +717 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6595000 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6597311 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6597891 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +942 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1162 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +72 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +6601145 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2102 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource 1 wrapCloseInAction) +6568558 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +717 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6595000 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6597311 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6597891 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +942 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1162 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +72 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +6601145 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2102 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource 1 wrapCloseInAction) +6568558 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +717 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6595000 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6597311 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6597891 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +942 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1162 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +72 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +6601145 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2102 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource 1重试,DbConnectionOptions userOptions,DbConnectionInternal&连接)+116 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,Tas kCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource 1重试,DbConnectionOptions userOptions)+6605639 System(In。 1 retry) +233 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource TaskCompletionSource 1 retry) +233 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource重试1 retry) +233 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1)+278 System.Data.SqlClient.SqlConnection.Open 1.Dispatch(TTarget target, Action )+239 System.Data.Entity.Infrastructure.Interception.InternalDispatcher 1.Dispatch(TTarget target, Action 2操作,TInterceptionContext拦截上下文, 3 executing, Action操作3 executing, Action 3)+207 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection连接,DbInterceptionContext拦截上下文)+438 System.Data.Entity.SqlServer。 <> c__DisplayClass33.b__32()+582 System.Data.Entity.SqlServer。<> c__DisplayClass1.b__0()+15 System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(功能1 operation) +263 System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action 1行动)+749 System.Data。 Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection连接,可空1 commandTimeout, StoreItemCollection storeItemCollection) +314 System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +329 System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +230 System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func 3 createMigrator,ObjectContext objectContext)+130 System.Data.Entity.Database.Create(DatabaseExistenceState existState)+267 System.Data.Entity .CreateDatabaseIfNotExists 1.InitializeDatabase(TContext context) +217 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +66 System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +596 System.Data.Entity.Internal.RetryAction 1.InitializeDatabase(TContext context) +217 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +66 System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +596 System.Data.Entity.Internal.RetryAction (TInput输入)+208 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(操作1 action) +263 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39 System.Data.Entity.Internal.Linq.InternalSet 1.Initialize() 1.get_InternalContext() +21 System.Data.Entity.Infrastructure.DbQuery System.Data.Entity.Internal.Linq.InternalSet 1.get_InternalContext() +21 System.Data.Entity.Infrastructure.DbQuery 1.System.Linq.IQueryable.get_Provider()+64 System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable 1 source, Expression 1谓词,CancellationToken cancelledToken)+218系统.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable 1 source, Expression 1谓词)+113 Microsoft.AspNet.Identity.d__13.MoveNext()+229 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)+144 System.Runtime .CompilerServices.TaskAwaiter.Hand leNonSuccessAndDebuggerNotification(任务任务)+84 Microsoft.AspNet.Identity.d__d.MoveNext()+455 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)+144 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(84) System.Runtime.CompilerServices.TaskAwaiter 1.GetResult() +49 Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func 1函数)+235 DaveyMaherFitness.Logic.RoleActions.AddUserAndRole()+151

[HttpException(0x80004005):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 服务器未找到或无法访问。 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26-错误指定服务器/实例的位置)] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext上下文,HttpApplication应用)+12601933 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext,HttpContext上下文,MethodInfo []处理程序)+175 System.Web.HttpApplication.InitSpecial(HttpApplicationState状态,MethodInfo []处理程序,IntPtr appContext,HttpContext上下文)+304 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext,HttpContext上下文)+404 System.Web。 Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)+475

[HttpException(0x80004005):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 服务器未找到或无法访问。 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26-错误指定服务器/实例的位置)] System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文)+12618980 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文)+159 System.Web.HttpRuntime .ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext上下文)+12458597

任何建议将不胜感激,我觉得我只是在忽略一些东西!

这只是说明它无法建立与服务器的连接,并且可能有很多原因。

可能是SQL-SERVER配置的Windows模式身份验证,而您正在尝试sql-server身份验证。 或未为远程连接配置sql-server或使用了错误的凭据。 或更糟糕的是您的连接字符串不正确。

无论如何,我强烈建议在VS中使用“服务器”面板,并在该面板上进行测试连接,这使您更容易找出问题所在。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM