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);
}