执行命令定义时发生错误。有关详细信息,请参见内部异常 [英] An error occurred while executing the command definition. See the inner exception for details

查看:1497
本文介绍了执行命令定义时发生错误。有关详细信息,请参见内部异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的mvc asp.net应用程序中,我在编辑功能中遇到错误:在给定的代码中

In my mvc asp.net application, I am getting an error in edit function : in given code

public ActionResult Edit(int id)
{

      var res = (from r in objeEntities.DocumentationsSet.Include("DocStatus")
                where r.textid == id select r)
                .First();
}

我收到此异常:

Source : System.Data.Entity

Stack Trace : 
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) 
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext
   context, ObjectParameterCollection parameterValues) 
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) 
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.b__0[TResult](IEnumerable`1 sequence) 
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.First[TSource](IQueryable`1 source)
at admin.com.Controllers.DocsGridController.Edit(Int32 id) in c:\Data\FinalCode\AC015\acomMVCSourceCode\admincom\Controllers\DocsController.cs:line
   307

Message : An error occurred while executing the command definition. See the inner exception for details.

当我与远程服务器连接时会生成此错误。

This error is generated when I connect with remote server.

这是什么错误?我该如何解决?

What is this error? How do I fix it?

推荐答案

通常,这意味着您的架构和映射文件不同步,并且已重命名或某处缺少列。

Usually this means that your schema and mapping files are not in synch and there is a renamed or missing column someplace.

这篇关于执行命令定义时发生错误。有关详细信息,请参见内部异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆