SQL Server 2008中的地理空间类型是什么ADO类型?
|
我希望重构此方法(来自Rob Conery的Massive.cs):
public static void AddParam(this DbCommand cmd, object item) {
var p = cmd.CreateParameter();
p.ParameterName = string.Format(\"@{0}\", cmd.Parameters.Count);
if (item == null) {
p.Value = DBNull.Value;
} else {
if (item.GetType() == typeof(Guid)) {
p.Value = item.ToString();
p.DbType = DbType.String;
p.Size = 4000;
} else if (item.GetType() == typeof(ExpandoObject)) {
var d = (IDictionary<string, object>)item;
p.Value = d.Values.FirstOrDefault();
} else {
p.Value = item;
}
//from DataChomp
if (item.GetType() == typeof(string))
p.Size = 4000;
}
cmd.Parameters.Add(p);
}
可能添加对Geographic类型的检查将解决ExecuteNonQuery和空间数据类型的问题,但是我将检查哪种类型?
if (item.GetType() == typeof(//WhatType?//)) {}
没有找到相关结果
已邀请:
2 个回复
卧沫
目浆搽