public override string ConvertObjectToXml(object value) { if ((value == null) || (value == base.NullValue)) { return(string.Empty); } Type dataType = base.DataType; if ((dataType == typeof(byte[])) || ((dataType == typeof(object)) && (value is byte[]))) { return(Convert.ToBase64String((byte[])value)); } if ((dataType == typeof(Type)) || ((dataType == typeof(object)) && (value is Type))) { return(((Type)value).AssemblyQualifiedName); } if (!DataStorage.IsTypeCustomType(value.GetType())) { return((string)SqlConvert.ChangeTypeForXML(value, typeof(string))); } if (Type.GetTypeCode(value.GetType()) != TypeCode.Object) { return(value.ToString()); } StringWriter w = new StringWriter(base.FormatProvider); if (this.implementsIXmlSerializable) { using (XmlTextWriter writer2 = new XmlTextWriter(w)) { ((IXmlSerializable)value).WriteXml(writer2); } return(w.ToString()); } GetXmlSerializer(value.GetType()).Serialize((TextWriter)w, value); return(w.ToString()); }