if (thisDataSet == null) { return; }
// Create a file name to write to.
string filename = "myXmlDoc.xml";
// Create the FileStream to write with.
System.IO.FileStream myFileStream = new System.IO.FileStream
(filename, System.IO.FileMode.Create);
// Create an XmlTextWriter with the fileStream.
System.Xml.XmlTextWriter myXmlWriter =
new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);
// Write to the file with the WriteXml method.
thisDataSet.WriteXml(myXmlWriter);
myXmlWriter.Close();
// Create a file name to write to.
string filename = "myXmlDoc.xml";
// Create the FileStream to write with.
System.IO.FileStream myFileStream = new System.IO.FileStream
(filename, System.IO.FileMode.Create);
// Create an XmlTextWriter with the fileStream.
System.Xml.XmlTextWriter myXmlWriter =
new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);
// Write to the file with the WriteXml method.
thisDataSet.WriteXml(myXmlWriter);
myXmlWriter.Close();
解决方案 »
- 编写一个为u盘加密的程序
- C# Form treeView 点击节点触发事件是什么?
- 如何捕捉鼠标在自定义控件之外单击或者双击
- 那个大哥救救我,怎么把一个时间转为格林威子时间???
- 紧急求助,ACCESS数据库无法删除记录,在线等待,谢谢!
- 未找到产品visual studio.net Enterprise Architect 2003-chs的有效源是什么原因 ?
- 请问怎么得到datagrid 的值,当我单击某一行某一列得到这一行一列的值
- 声明数组
- 请问winform 里面怎样使datagrid 显示date时, 只显示日期部分, 不显示时间部分?
- 点击框架左边的树,超时.重新登入后,在框架右边显示左边所点选的对应页面???
- 在一个窗口中new了一个新窗口,怎么在新窗口中得到前面窗口
- 100分!!!求关于服务器端的时间控制的问题?
string fName =@"c:\myXMLFile.xml";
System.IO.FileStream myStream = new System.IO.FileStream(fName,System.IO.FileMode.Create);
xmlStream.Close();
System.Xml.XmlTextWriter myXmlWriter = new System.Xml.XmlTextWriter(xmlFile , System.Text.Encoding.Unicode);
myDataSet.WriteXml(myXmlWriter);
myXmlWriter.Close();