首页 新闻 赞助 找找看

SqlBoolean为什么返回{Null}

0
悬赏园豆:10 [已关闭问题] 关闭于 2017-07-15 18:03

数据库用的是 SqlServer2014,C#.net开发

SqlBoolean为什么返回{Null}?传入的点和面的数据都没问题,求高手指点。

大神老姜的主页 大神老姜 | 初学一级 | 园豆:132
提问于:2017-07-14 16:40
< >
分享
所有回答(2)
0

point.STWithin失败了吧

慧☆星 | 园豆:5640 (大侠五级) | 2017-07-15 09:24
0
1 [SqlMethod(IsDeterministic = true, IsPrecise = false)]
2     public SqlBoolean STWithin(SqlGeometry other)
3     {
4       if (this.IsNull || other == null || (other.IsNull || this.Srid != other.Srid))
5         return SqlBoolean.Null;
6       this.ThrowIfInvalid();
7       other.ThrowIfInvalid();
8       return (SqlBoolean) GLNativeMethods.Contains(other.GeoData, this.GeoData);
9     }

自己解决了,看了反编译的Microsoft.SqlServer.Types的源代码发现是因为点和面的Srid不一致导致的。

大神老姜 | 园豆:132 (初学一级) | 2017-07-15 18:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册