判断数据类型
IConvertible conv = obj as IConvertible; if (conv != null) { switch (conv.GetTypeCode()) { case TypeCode.Boolean: break; case TypeCode.Byte: break; case TypeCode.Char: break; case TypeCode.DBNull: break; case TypeCode.DateTime: break; case TypeCode.Decimal: break; case TypeCode.Double: break; case TypeCode.Empty: break; case TypeCode.Int16: break; case TypeCode.Int32: break; ... ... default: break; } } else { //处理其他类型 }