新人再问 sql/linq: No connection string name d 'db5Entities' could be found in the application config fi# DotNet - 窗口里的风景
w*s
1 楼
1. in F:charp, i have my c# application project, and a DB file called db5.
mdx
2. in my c# project i uses this db5.mdx, using EF
3. now i copied the exe built from c# project to another folder and run it,
and got this, any hints pls ?
Unhandled Exception: System.InvalidOperationException: No connection string
name
d 'db5Entities' could be found in the application config file.
at System.Data.Entity.Internal.LazyInternalConnection.get_
ConnectionHasModel(
)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.
GetEntitySetAndBaseTypeForType
(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get
_Pro
vider()
at System.Linq.Queryable.Any[TSource](IQueryable`1 source, Expression`1
predi
cate)
at StockAnalyze.Analyze.ProcessRawStockData(String stock, Int32 mv_days,
Int3
2 p_days)
mdx
2. in my c# project i uses this db5.mdx, using EF
3. now i copied the exe built from c# project to another folder and run it,
and got this, any hints pls ?
Unhandled Exception: System.InvalidOperationException: No connection string
name
d 'db5Entities' could be found in the application config file.
at System.Data.Entity.Internal.LazyInternalConnection.get_
ConnectionHasModel(
)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.
GetEntitySetAndBaseTypeForType
(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get
_Pro
vider()
at System.Linq.Queryable.Any[TSource](IQueryable`1 source, Expression`1
predi
cate)
at StockAnalyze.Analyze.ProcessRawStockData(String stock, Int32 mv_days,
Int3
2 p_days)