18 public static SqlType XmlType {
get;
private set; }
22 if (xmlNode == null || xmlNode.IsNull)
25 if (destType == typeof (
string))
26 return xmlNode.ToString();
27 if (destType == typeof (XmlNode))
29 if (destType == typeof (byte[]))
30 return xmlNode.ToBytes();
32 return base.ConvertTo(obj, destType);
36 return base.DeserializeObject(stream);
40 base.SerializeObject(stream, obj);
53 var destTypeCode = destType.
TypeCode;
54 switch (destTypeCode) {
66 throw new InvalidCastException(
String.Format(
"Cannot cast XML node to type '{0}'.", destType));
static DataObject Binary(SqlBinary binary)
A long string in the system.
override DataObject CastTo(DataObject value, SqlType destType)
Converts the given object value to a SqlType specified.
override void SerializeObject(Stream stream, ISqlObject obj)
static DataObject Null(SqlType type)
ISqlObject Value
Gets the underlined value that is handled.
static DataObject String(string s)
SqlTypeCode TypeCode
Gets the kind of SQL type this data-type handles.
Defines the contract for a valid SQL Object
override object ConvertTo(ISqlObject obj, Type destType)
override ISqlObject DeserializeObject(Stream stream)
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Defines the properties of a specific SQL Type and handles the values compatible.
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
override bool CanCastTo(SqlType destType)
Verifies if this type can cast any value to the given SqlType.