ConnectionString属性尚未初始化实体框架

时间:2017-07-21 09:54:34

标签: entity-framework

底层提供程序在Open上失败。

  

错误简述:ConnectionString属性尚未初始化   错误内部描述:
  在System.Data.Entity.Core.EntityClient.EntityConnection.Open()
  在System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)      在System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction [T](Func 1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery 1.&lt;&gt; c__DisplayClass7.b__5()      at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute [TResult](Func 1 operation) at System.Data.Entity.Core.Objects.ObjectQuery 1.GetResults(Nullable 1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery 1..GetEnumerator&gt; b__0()      在System.Data.Entity.Internal.LazyEnumerator 1.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable 1来源)      在System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.b__1 [TResult](IEnumerable 1 sequence) at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable 1查询,表达式queryRoot)      at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute [TResult](表达式表达式)      at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute [TResult](表达式表达式)      在System.Linq.Queryable.FirstOrDefault [TSource](IQueryable 1 source) at SKAI.BusinessLayer.AnalysisTreatmentBL.GetAdviceDetails(Int32 KeywordId) at SKAI_Dev.Controllers.Analysis.KeywordAnalysisController.GetNeedAdviceDetails(Int32 KeywordId) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary 2个参数)      在System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,ActionDescriptor actionDescriptor,IDictionary 2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 2.CallEndDelegate(IAsyncResult asyncResult)      在System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase 1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 1.CallEndDelegate(IAsyncResult asyncResult)      在System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()      在System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)      在System.Web.Mvc.Async.AsyncControllerActionInvoker。&lt;&gt; c__DisplayClass21。&lt;&gt; c__DisplayClass2b.b__1c()      在System.Web.Mvc.Async.AsyncControllerActionInvoker。&lt;&gt; c__DisplayClass21.b__1e(IAsyncResult asyncResult)

0 个答案:

没有答案