连接字符串:' /'中的服务器错误应用

时间:2015-11-16 05:11:25

标签: c# .net sql-server entity-framework connection-string

 Server Error in '/' Application.

    The system cannot find the file specified

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace
     

有关错误及其来源的更多信息   码。

    Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location
     可以使用异常堆栈跟踪来识别异常的

  下方。

连接字符串

<add name="DashboardManagementEntities" connectionString="metadata=res://*/Models.ManagementEntities.csdl|res://*/Models.ManagementEntities.ssdl|res://*/Models.ManagementEntities.msl;provider=System.Data.SqlClient;provider connection string='Data Source=(LocalDB)\v11.0;AttachDbFilename=&quot;C:\Database\abc.mdf&quot;;Integrated Security=True;Application Name=EntityFramework'" providerName="System.Data.EntityClient" />
    <add name="DatabaseModel" connectionString="Data Source=(localdb)\v11.0;AttachDbFilename=&quot;C:\Database\abc.mdf&quot;;Integrated Security=True" providerName="System.Data.SqlClient" />

堆栈跟踪

  

[Win32Exception(0x80004005):系统找不到该文件   指定]

     

[SqlException(0x80131904):与网络相关或特定于实例的   建立与SQL Server的连接时发生错误。该   服务器未找到或无法访问。验证该实例   名称是正确的,并且SQL Server配置为允许远程   连接。 (提供者:SQL网络接口,错误:52 - 无法使用   找到本地数据库运行时安装。验证SQL Server   Express已正确安装并且是本地数据库运行时   功能已启用。)]
  System.Data.SqlClient.SqlInternalConnection.OnError(SQLEXCEPTION   exception,Boolean breakConnection,Action 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) +6597350
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 retry,DbConnectionOptions   userOptions,DbConnectionInternal&amp;连接)+116
  System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(的DbConnection   owningConnection,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1次重试,DbConnectionOptions userOptions)   +6605639 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) +233
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
1   重试)+278 System.Data.SqlClient.SqlConnection.Open()+239
  System.Data.Entity.Infrastructure.Interception.InternalDispatcher 1.Dispatch(TTarget target, Action 2操作,TInterceptionContext interceptionContext,   行动3 executing, Action 3已执行)+207
  System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(的DbConnection   connection,DbInterceptionContext interceptionContext)+438
  System.Data.Entity.SqlServer。&lt;&gt; c__DisplayClass1.b__0()+15
  System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1   操作)+263
  System.Data.Entity.Core.EntityClient.EntityConnection.Open()+ 436

     

[EntityException:底层提供程序在Open上失败。]
  System.Data.Entity.Core.EntityClient.EntityConnection.Open()+701
  System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(布尔   shouldMonitorTransactions)+170
  System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction(Func键1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) +70
System.Data.Entity.Core.Objects.<>c__DisplayClass7.<GetResults>b__5() +239 System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func
1   操作)+263
  System.Data.Entity.Core.Objects.ObjectQuery 1.GetResults(Nullable 1   forMergeOption)+368
  System.Data.Entity.Core.Objects.ObjectQuery 1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0() +11 System.Data.Entity.Internal.LazyEnumerator 1.MoveNext()+50 System.Collections.Generic.List 1..ctor(IEnumerable 1 collection)+536   System.Linq.Enumerable.ToList(IEnumerable`1 source)+80
  Dashboard.Models.UserRepository.Get(String id)+132
  Dashboard.Account.Login.LogIn(Object sender,EventArgs e)+134
  System.Web.UI.WebControls.Button.RaisePostBackEvent(字符串   eventArgument)+155
  System.Web.UI.d__14.MoveNext()+ 8108

如果有人能为我提供正确的连接字符串和解决方案,我将非常感激。

0 个答案:

没有答案