DataColumn 与Xml data type转换。
来源:互联网 发布:蛋糕西点软件 编辑:程序博客网 时间:2024/05/01 19:47
下面代码通过反射System.Data程序集得到
internal static string XmlDataTypeName(Type type)
{
if (type == typeof(char))
{
return "_";
}
if ((type == typeof(byte[])) || (type == typeof(SqlBytes)))
{
return "base64Binary";
}
if ((type == typeof(DateTime)) || (type == typeof(SqlDateTime)))
{
return "dateTime";
}
if (type == typeof(TimeSpan))
{
return "duration";
}
if (((type == typeof(decimal)) || (type == typeof(SqlDecimal))) || (type == typeof(SqlMoney)))
{
return "decimal";
}
if (type == typeof(int))
{
return "int";
}
if ((type == typeof(bool)) || (type == typeof(SqlBoolean)))
{
return "boolean";
}
if ((type == typeof(float)) || (type == typeof(SqlSingle)))
{
return "float";
}
if ((type == typeof(double)) || (type == typeof(SqlDouble)))
{
return "double";
}
if ((type == typeof(sbyte)) || (type == typeof(SqlByte)))
{
return "byte";
}
if (type == typeof(byte))
{
return "unsignedByte";
}
if ((type == typeof(short)) || (type == typeof(SqlInt16)))
{
return "short";
}
if ((type == typeof(int)) || (type == typeof(SqlInt32)))
{
return "int";
}
if ((type == typeof(long)) || (type == typeof(SqlInt64)))
{
return "long";
}
if (type == typeof(ushort))
{
return "unsignedShort";
}
if (type == typeof(uint))
{
return "unsignedInt";
}
if (type == typeof(ulong))
{
return "unsignedLong";
}
if (type == typeof(Uri))
{
return "anyURI";
}
if (type == typeof(SqlBinary))
{
return "hexBinary";
}
if (((type == typeof(string)) || (type == typeof(SqlGuid))) || ((type == typeof(SqlString)) || (type == typeof(SqlChars))))
{
return "string";
}
if ((type != typeof(object)) && (type != typeof(SqlXml)))
{
return string.Empty;
}
return "anyType";
}
- DataColumn 与Xml data type转换。
- DataColumn
- Integration with the XML Data Type
- XML与Data Binding
- TYPES与DATA TYPE与LIKE 区别
- jmeter- Response data与Content Type
- Data、Type属性与intent-filter配置
- Data、Type属性与intent-filter配置
- C#新建DataColumn类时Type类型参数的生成方式
- #pragma mark data转换成String nsstring 与 nsstring不同格式之间的转换 date(需要转换的数据NSStringOrNSDate均可) type(原来的格式
- Data Type
- Data Type
- DATA TYPE
- Data Type
- Xml data type is not supported in distributed queries.
- data-type,data-value
- xml与Dataset转换
- XML与JSON转换
- SQL 2005 体验版 基本安装和使用 (1)
- ISO-2022
- Oracle 查询基础 (转)
- 配置Asp.net Ajax Control Toolkit
- PHP程序加速探索之压缩输出gzip
- DataColumn 与Xml data type转换。
- 利用SCR文件给注册表解锁
- COM实现取outlook地址簿
- 关于const于pointer
- SQL 2005 体验版 基本安装和使用 (2)
- SMS2003 DB中查询关于patch部署的信息
- HTTP协议中的Tranfer-Encoding:chunked编码解析
- 但求谁可留住这一生
- VS快捷键集锦