// Set the file path and name. Modify this for your purposes. string filename="mySchema.xml"; // Create a FileStream object with the file path and name. System.IO.FileStream myFileStream = new System.IO.FileStream (filename,System.IO.FileMode.Create); // Create a new XmlTextWriter object with the FileStream. System.Xml.XmlTextWriter MyXmlTextWriter = new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode); // Write the schema into the DataSet and close the reader. thisDataSet.WriteXmlSchema(MyXmlTextWriter ); MyXmlTextWriter.Close();
// Set the file path and name. Modify this for your purposes.
string filename="mySchema.xml";
// Create a FileStream object with the file path and name.
System.IO.FileStream myFileStream = new System.IO.FileStream
(filename,System.IO.FileMode.Create);
// Create a new XmlTextWriter object with the FileStream.
System.Xml.XmlTextWriter MyXmlTextWriter =
new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);
// Write the schema into the DataSet and close the reader.
thisDataSet.WriteXmlSchema(MyXmlTextWriter );
MyXmlTextWriter.Close();
<Customers>
<年份>2001</年份>
<建筑业>6462</建筑业>
</Customers>
本人需要的效果是
<Customers 年份=2001>
<建筑业>6462</建筑业>
</Customers>
各位兄弟看清要求,请指教