Mysql 列名更改后字段列表中出现未知列错误

Mysql 列名更改后字段列表中出现未知列错误,mysql,entity-framework,Mysql,Entity Framework,当我使用entity framework访问具有“Notify”列的表来运行C#服务时,我不断遇到此错误: Unknown column 'Extent1.Notify' in 'field list 该列以前被命名为“fetch”。我已经在数据库和代码优先对象中将其从'fetch'重命名为'notify'。相同的操作使用相同的代码,但使用不同的数据库。比较这些数据库没有发现任何差异。错误发生在提取行时,列/字段未被显式访问。 可能是什么?这是我应该清理的缓存吗 完整错误: <s:Env

当我使用entity framework访问具有“Notify”列的表来运行C#服务时,我不断遇到此错误:

Unknown column 'Extent1.Notify' in 'field list
该列以前被命名为“fetch”。我已经在数据库和代码优先对象中将其从'fetch'重命名为'notify'。相同的操作使用相同的代码,但使用不同的数据库。比较这些数据库没有发现任何差异。错误发生在提取行时,列/字段未被显式访问。 可能是什么?这是我应该清理的缓存吗

完整错误:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
  <s:Fault>
     <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
     <faultstring xml:lang="de-DE">An error occurred while executing the command definition. See the inner exception for details.</faultstring>
     <detail>
        <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
           <HelpLink i:nil="true"/>
           <InnerException>
              <HelpLink i:nil="true"/>
              <InnerException i:nil="true"/>
              <Message>Unknown column 'Extent1.Notify' in 'field list'</Message>
              <StackTrace>bei MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   bei MySql.Data.MySqlClient.NativeDriver.GetResult(Int32&amp; affectedRow, Int64&amp; insertedId)
   bei MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32&amp; affectedRows, Int64&amp; insertedId)
   bei MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   bei MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   bei MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   bei System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   bei System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)
   bei System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   bei System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   bei System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   bei System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   bei System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)</StackTrace>
              <Type>MySql.Data.MySqlClient.MySqlException</Type>
           </InnerException>
           <Message>An error occurred while executing the command definition. See the inner exception for details.</Message>
           <StackTrace><![CDATA[bei System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   bei System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   bei System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   bei System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   bei System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   bei System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
   bei System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   bei System.Data.Entity.Core.Objects.ObjectQuery`1.Execute(MergeOption mergeOption)
   bei System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(List`1 collection, MergeOption mergeOption)
   bei System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(MergeOption mergeOption)
   bei System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad()
   bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem](TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject)
   bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.<>c__DisplayClass7`2.<GetInterceptorDelegate>b__1(TProxy proxy, TItem item)
   bei System.Data.Entity.DynamicProxies.DataOwner_CEB42FCAF876F5652D9C5F2E8892BF0622E3A8A320222EA9E392E00E8F3C36D7.get_Years()
   bei VaStSystem.VaStCentral.GetDataOwnerElement(DataOwner owner, String email)
   bei VaStSystem.VaStCentral.HoleDatenInhaberInfo(String steuerId)
   bei VaStAbrufServiceApplication.VaStBelegAbrufService.HoleDatenInhaberInfo(String ecomUser, String ecomPwd, String steuerId)
   bei SyncInvokeHoleDatenInhaberInfo(Object , Object[] , Object[] )
   bei System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   bei System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)]]></StackTrace>
           <Type>System.Data.Entity.Core.EntityCommandExecutionException</Type>
        </ExceptionDetail>
     </detail>
  </s:Fault>

a:内部故障
执行命令定义时出错。有关详细信息,请参见内部异常。
“字段列表”中的未知列“Extent1.Notify”
bei MySql.Data.MySqlClient.MySqlStream.ReadPacket()
bei MySql.Data.MySqlClient.NativeDriver.GetResult(Int32&;affectedRow、Int64&;insertedId)
bei MySql.Data.MySqlClient.Driver.GetResult(Int32语句ID、Int32和affectedRows、Int64和insertedId)
bei MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId,Boolean force)
bei MySql.Data.MySqlClient.MySqlDataReader.NextResult()
bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior)
bei MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior)
bei System.Data.Common.DbCommand.ExecuteReader(CommandBehavior)
bei System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader>b_uuC(DbCommand t,DbCommandInterceptionContext`1C)
bei System.Data.Entity.Infrastructure.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget,Func`3操作,TInterceptionContext拦截Context,执行操作`3,执行操作`3)
bei System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand命令,DbCommandInterceptionContext interceptionContext)
bei System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior)
bei System.Data.Common.DbCommand.ExecuteReader(CommandBehavior)
bei System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand EntityCommand,CommandBehavior)
MySql.Data.MySqlClient.MySqlException
执行命令定义时出错。有关详细信息,请参见内部异常。
c__显示类7.b__6()
bei System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 Func,IDBEcutionStrategy executionStrategy,Boolean startLocalTransaction,Boolean ReleaseConnectionUnsuccess)
bei System.Data.Entity.Core.Objects.ObjectQuery`1.c__显示类7.b__5()
bei System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1操作)
bei System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(可为null`1 forMergeOption)
bei System.Data.Entity.Core.Objects.ObjectQuery`1.Execute(合并选项合并选项)
bei System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(列表`1集合,合并选项)
bei System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(合并选项)
bei System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad()
bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem](TItem propertyValue,String relationshipName,String targetRoleName,Boolean mustBeNull,Object wrapperObject)
bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.c__DisplayClass7`2.b__1(TProxy代理,TItem项)
bei System.Data.Entity.DynamicProxies.DataOwner_CEB42FCAF876F5652D9C5F2E8892BF0622E3A8A320222EA9E392E00E8F3C36D7.获取年数()
bei VaStSystem.VaStCentral.GetDataOwnerElement(数据所有者,字符串电子邮件)
bei VaStSystem.VaStCentral.HoleDatenInhaberInfo(字符串steuerId)
bei VaStAbrufServiceApplication.VaStBelegAbrufService.HoleDatenInhaberInfo(字符串ecomUser、字符串ecomPwd、字符串steuerId)
bei SyncInvokeHolateInHaberInfo(对象,对象[],对象[])
bei System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例、对象[]输入、对象[]输出)
bei System.ServiceModel.Dispatcher.DispatcheOperationRuntime.InvokeBegin(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&rpc)
bei System.ServiceModel.Dispatcher.MessageRpc.Process(布尔等操作上下文集)]]>
System.Data.Entity.Core.EntityCommandExecutionException

您是否创建(并运行)了CodeFirst迁移?没有。是的,你需要在谷歌上更新你的db.search,或者,你会找到在谷歌上更新db.search的方法吗?事实上,更新失败了。我所做的是使用它工作的数据库和以前的数据的结构重新创建数据库,但它仍然不工作。它与另一个完全相同的mysql数据库一起工作。我再也不了解生活了。你创建(并运行)了CodeFirst迁移吗?没有。它在任何地方都是必要的,甚至在生产系统上也是必要的吗