每当我尝试从DB添加/更新模型时,它总会抛出此错误,任何人都可以帮我解决这个错误吗?
由于以下异常,无法生成模型: 'System.Data.Entity.Core.EntityCommandExecutionException:错误 执行命令定义时发生。看到内心 细节例外。 ---> System.Data.SqlClient.SqlException:The 传入请求的参数太多。服务器支持 最多2100个参数。减少参数数量并重新发送 请求。在 System.Data.SqlClient.SqlConnection.OnError(SqlException异常, 布尔值breakConnection,Action
1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,Boolean callerHasConnectionLock,Boolean asyncClose)at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler,SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj,布尔& dataReady)at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()at System.Data.SqlClient.SqlDataReader.get_MetaData()at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior,String resetOptionsString)at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(的CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,Boolean async,Int32超时,任务& task,Boolean asyncWrite,SqlDataReader ds)at System.Data.SqlClient.SqlCommand.RunExecuteReader(的CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String 方法,TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
1 c)at System.Data.Entity.Infrastructure.Interception.InternalDispatcher
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func
3操作,TInterceptionContext interceptionContext, 行动3 executing, Action
3已执行) System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(的DbCommand 命令,DbCommandInterceptionContext interceptionContext)at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(的CommandBehavior 行为) System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior行为)---内部异常结束
答案 0 :(得分:0)
这种错误通常是由模型中的许多对象引起的(看起来就像所有程序一样)并且Entity Framework不够智能,无法使多个数据库往返。