加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 数据库 > MsSql > 正文

SqlDbType和Geography

发布时间:2020-05-24 16:25:28 所属栏目:MsSql 来源:互联网
导读:当我的列是Geography类型时,我应该使用什么SqlDbType枚举?我正在使用MS SQL Server 2008 R2. 这是我正在寻找的具体内容: // ADO.net - what do I use for the SqlDbType when its defined // as Geography in the stored procSqlCommand command = n

当我的列是Geography类型时,我应该使用什么SqlDbType枚举?我正在使用MS SQL Server 2008 R2.

这是我正在寻找的具体内容:

// ADO.net - what do I use for the SqlDbType when it's defined 
// as Geography in the stored proc
SqlCommand command = new SqlCommand();
command.CommandText = "dbo.up_Foobar_Insert";
command.CommandType = CommandType.StoredProcedure;

command.Parameters.Add("@SomeGeographyType",SqlDbType.????);

解决方法

更新

试试这个:

//define parameter
command.Parameters.Add("@shape",SqlDbType.NVarChar);
//
//code in between omitted
//
//set value of parameter
command.Parameters["@shape"].Value = feature.Geometry.AsText();

取自Inserting SQL 2008 Geometry With a SqlCommand

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读