private Type ConvertDatatype (XmlSchemaDatatype dt)
{
if (dt == null)
return typeof (string);
else if (dt.ValueType == typeof (decimal)) {
// LAMESPEC: MSDN documentation says it is based
// on ValueType. However, in the System.Xml.Schema
// context, xs:integer is mapped to Decimal, while
// in DataSet context it is mapped to Int64.
if (dt == schemaDecimalType)
return typeof (decimal);
else if (dt == schemaIntegerType)
return typeof (long);
else
return typeof (ulong);
}
else
return dt.ValueType;
}