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

InferXmlSchema() public method

Infer the XML schema from the specified into the .
public InferXmlSchema ( Stream stream, string nsArray ) : void
stream Stream
nsArray string
return void
        public void InferXmlSchema(Stream stream, string[] nsArray)
        {
            if (stream == null)
            {
                return;
            }

            InferXmlSchema(new XmlTextReader(stream), nsArray);
        }

Same methods

DataSet::InferXmlSchema ( TextReader reader, string nsArray ) : void
DataSet::InferXmlSchema ( XmlReader reader, string nsArray ) : void
DataSet::InferXmlSchema ( string fileName, string nsArray ) : void

Usage Example

		public void SimpleLoad ()
		{
			string xml001 = "<root/>";
			XmlDataDocument doc = new XmlDataDocument ();
			DataSet ds = new DataSet ();
			ds.InferXmlSchema (new StringReader (xml001), null);
			doc.LoadXml (xml001);

			string xml002 = "<root><child/></root>";
			doc = new XmlDataDocument ();
			ds = new DataSet ();
			ds.InferXmlSchema (new StringReader (xml002), null);
			doc.LoadXml (xml002);

			string xml003 = "<root><col1>test</col1><col1></col1></root>";
			doc = new XmlDataDocument ();
			ds = new DataSet ();
			ds.InferXmlSchema (new StringReader (xml003), null);
			doc.LoadXml (xml003);

			string xml004 = "<set><tab1><col1>test</col1><col1>test2</col1></tab1><tab2><col2>test3</col2><col2>test4</col2></tab2></set>";
			doc = new XmlDataDocument ();
			ds = new DataSet ();
			ds.InferXmlSchema (new StringReader (xml004), null);
			doc.LoadXml (xml004);
		}
All Usage Examples Of System.Data.DataSet::InferXmlSchema