WriteXMLForReport

        /// <summary>
        /// Writes xsd for report into specified directory
        /// </summary>
        /// <param name="tblIn">DataTable with XML Schema that you want to write</param>
        /// <param name="outputName">Name of xsd you want back.</param>
        public static void WriteXMLForReport(this DataTable tblIn, string outputName)
        {
            //Set table name in case it is not set
            tblIn.TableName = outputName;
            string fileName = @"C:\OutDir\" + outputName + ".xsd";
            tblIn.WriteXmlSchema(fileName, true);
        }
Example:
tblAnyTable.WriteXMLForReport("AnyTableOut");

Description

Many times you need an XSD file for a report. I have created this extension to write the xsd based on the data table I feed it into the directory I set.

Details

Double click on the code to select all.

 

;