error 2010: The Column 'MaxSpeed' specified as part of this MSL does not exiMaxspeed 这一列,是我新增的。 实体也更新了,但就是提示说不在当前架构中?哪位朋友遇到过这种问题么?在线等

解决方案 »

  1.   

    单步调试一下,看dataContxt的Connectstring是不是和你想连的数据库一致
    重新映射DBML时有可能改变了连接字符串
      

  2.   


       捕捉到 System.Data.MappingException
      Message=指定的架构无效。错误: 
    GpsDecoding.msl(153,12) : 错误 2010: 指定为该 MSL 一部分的列“MaxSpeed”不存在于 MetadataWorkspace 中。
      Source=System.Data.Entity
      StackTrace:
           在 System.Data.Mapping.StorageMappingItemCollection.Init(EdmItemCollection edmCollection, StoreItemCollection storeCollection, IEnumerable`1 xmlReaders, List`1 filePaths, Boolean throwOnError)
           在 System.Data.Metadata.Edm.MetadataCache.StoreMetadataEntry.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader)
           在 System.Data.Metadata.Edm.MetadataCache.StoreItemCollectionLoader.LoadItemCollection(StoreMetadataEntry entry)
           在 System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry)
           在 System.Data.Metadata.Edm.MetadataCache.GetOrCreateStoreAndMappingItemCollections(String cacheKey, MetadataArtifactLoader loader, EdmItemCollection edmItemCollection, Object& entryToken)
           在 System.Data.EntityClient.EntityConnection.LoadStoreItemCollections(MetadataWorkspace workspace, DbConnection storeConnection, DbProviderFactory factory, DbConnectionOptions connectionOptions, EdmItemCollection edmItemCollection, MetadataArtifactLoader artifactLoader)
           在 System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
           在 System.Data.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure)
           在 System.Data.EntityClient.EntityConnection.Open()
           在 System.Data.Objects.ObjectContext.EnsureConnection()
           在 System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
           在 System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
           在 LastPositionService.LastPosiHandler.Start() 位置 F:\SVN_AW\04 代码\GpsCenter\LastPositionService\LastPosiHandler.cs:行号 115
      InnerException: