System.Data.DataTable.GetDataTableSchema C# (CSharp) Method

GetDataTableSchema() public static method

public static GetDataTableSchema ( XmlSchemaSet schemaSet ) : XmlSchemaComplexType
schemaSet XmlSchemaSet
return XmlSchemaComplexType
        public static XmlSchemaComplexType GetDataTableSchema(XmlSchemaSet schemaSet)
        {
            XmlSchemaComplexType type = new XmlSchemaComplexType();
            XmlSchemaSequence sequence = new XmlSchemaSequence();
            XmlSchemaAny any = new XmlSchemaAny();
            any.Namespace = XmlSchema.Namespace;
            any.MinOccurs = 0;
            any.MaxOccurs = decimal.MaxValue;
            any.ProcessContents = XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any);

            any = new XmlSchemaAny();
            any.Namespace = Keywords.DFFNS;
            any.MinOccurs = 1; // when recognizing WSDL - MinOccurs="0" denotes DataSet, a MinOccurs="1" for DataTable
            any.ProcessContents = XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any);

            type.Particle = sequence;

            return type;
        }
DataTable