System.Data.DataSet.DataSet C# (CSharp) Method

DataSet() protected method

protected DataSet ( SerializationInfo info, StreamingContext context, bool ConstructSchema ) : System.Collections
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
ConstructSchema bool
return System.Collections
        protected DataSet(SerializationInfo info, StreamingContext context, bool ConstructSchema) : this()
        {
            SerializationFormat remotingFormat = SerializationFormat.Xml;
            SchemaSerializationMode schemaSerializationMode = SchemaSerializationMode.IncludeSchema;
            SerializationInfoEnumerator e = info.GetEnumerator();

            while (e.MoveNext())
            {
                switch (e.Name)
                {
                    case "DataSet.RemotingFormat": //DataSet.RemotingFormat does not exist in V1/V1.1 versions
                        remotingFormat = (SerializationFormat)e.Value;
                        break;
                    case "SchemaSerializationMode.DataSet": //SchemaSerializationMode.DataSet does not exist in V1/V1.1 versions
                        schemaSerializationMode = (SchemaSerializationMode)e.Value;
                        break;
                }
            }

            if (schemaSerializationMode == SchemaSerializationMode.ExcludeSchema)
            {
                InitializeDerivedDataSet();
            }

            // adding back this check will fix typed dataset XML remoting, but we have to fix case that 
            // a class inherits from DataSet and just relies on DataSet to deserialize (see SQL BU DT 374717)
            // to fix that case also, we need to add a flag and add it to below check so return (no-op) will be 
            // conditional (flag needs to be set in TypedDataSet
            if (remotingFormat == SerializationFormat.Xml && !ConstructSchema)
            {
                return; //For typed dataset xml remoting, this is a no-op
            }

            DeserializeDataSet(info, context, remotingFormat, schemaSerializationMode);
        }

Same methods

DataSet::DataSet ( ) : System.Collections
DataSet::DataSet ( SerializationInfo info, StreamingContext context ) : System.Collections
DataSet::DataSet ( string dataSetName ) : System.Collections