SQL Server 地理数据类型:奇怪的行为
我有一个应用程序已经运行多年,没有任何问题。最近,我决定将地理类型列添加到应用程序使用的表之一。这样做之后,生产服务器上的网站开始出现问题:在使用表的地方出现奇怪的空引用异常。但更重要的是,该网站在我的开发机器上运行得很好。请注意,我所做的唯一更改是将列添加到表中。 DAL 或 BBL 中没有任何更改。 数据访问层是使用ADO.NED编写的。 我的开发计算机和生产服务器之间唯一真正的区别是我的计算机上安装了 SQL Server 2008 R2。 但仍然无法弄清楚为什么这会导致应用程序错误。如果我忽略 SELECT 语句中的地理列,代码可以正常工作,但是一旦存储过程也返回此列,代码就会停止工作。 难道DataSet不知道如何处理Geography类型的数据?
任何见解都受到高度赞赏。
I have an application that has been running for years now with no issues. Recently I decided to add a Geography type column to one of the tables, application uses. After doing so, the website on production server started acting up: weird null reference exceptions in places where the table was used. But what's more important, the site ran just fine on my development machine. Please note, that only change i did was to add the column to table. Nothing was changed in DAL or BBL.
The data access layer is written using ADO.NED.
The only real difference between my Dev machine and Production server is that i have SQL Server 2008 R2 installed on my machine.
But still can't figure out why this could have caused application errors. If i ignore the geography column from SELECT statements, code works fine, but as soon as the stored procedures also return this column, code stops working.
Can it be that DataSet does not know how to treat Geography type data?
Any insight is highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是很有可能的。 Geography 数据类型是内置 CLR 数据类型之一,因此我可以看到这是一个问题,特别是如果您使用的 ADO.NET 版本不知道它的话。
It's very possible. The Geography datatype is one of the built-in CLR datatypes, so I could see that being an issue especially if you're using a version of ADO.NET that isn't aware of it.