首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有与基元类型“Geography”的概念端类型“Geography”相对应的存储区类型

没有与基元类型“Geography”的概念端类型“Geography”相对应的存储区类型
EN

Stack Overflow用户
提问于 2016-09-16 05:06:26
回答 1查看 1.2K关注 0票数 1

在代码优先实现中使用Entity Framework6的MVC5站点上会出现此错误。有几个模型使用System.Data.Entity.Spatial.DbGeography,如下面的模型所示。

代码语言:javascript
复制
using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.Spatial;

namespace ProjectName.Models
{
    public class PostalCode
    {
        [Key]
        [MaxLength(10)]
        public string PostalCodeValue { get; set; }
        public int Country { get; set; }
        [MaxLength(2)]
        public string StateAbbr { get; set; }
        public DbGeography Geo { get; set; }
    }
}

在移动到外部测试环境的生产过程中,我们收到以下错误:

代码语言:javascript
复制
There is no store type corresponding to the conceptual side type 'Geography' of primitive type 'Geography'.

EN

回答 1

Stack Overflow用户

发布于 2016-09-16 05:06:26

这个错误有点误导人。在我们的示例中,连接字符串指向比SQL2012旧的站点的前一个版本的数据库。

发生这种情况的原因是因为目标数据库不能处理此数据类型。如果收到此消息,请验证连接字符串是否指向正确的数据库,以及它是否能够使用错误指定的数据类型。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39520364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档