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

ReadXmlSchema() public method

Reads the XML schema from the specified into the .
public ReadXmlSchema ( Stream stream ) : void
stream Stream
return void
        public void ReadXmlSchema(Stream stream)
        {
            if (stream == null)
            {
                return;
            }

            ReadXmlSchema(new XmlTextReader(stream), false);
        }

Same methods

DataSet::ReadXmlSchema ( TextReader reader ) : void
DataSet::ReadXmlSchema ( XmlReader reader ) : void
DataSet::ReadXmlSchema ( XmlReader reader, bool denyResolving ) : void
DataSet::ReadXmlSchema ( string fileName ) : void

Usage Example

 protected DatasetPatrols(SerializationInfo info, StreamingContext context) {
     string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
     if ((strSchema != null)) {
         DataSet ds = new DataSet();
         ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
         if ((ds.Tables["Patrols"] != null)) {
             this.Tables.Add(new PatrolsDataTable(ds.Tables["Patrols"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.InitClass();
     }
     this.GetSerializationData(info, context);
     System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
     this.Tables.CollectionChanged += schemaChangedHandler;
     this.Relations.CollectionChanged += schemaChangedHandler;
 }
All Usage Examples Of System.Data.DataSet::ReadXmlSchema