两种将dataset写入到xml的方法

1. //mydsClone.WriteXml(MapPath("/Home/data.xml"));
  2.      XmlWriter xtw = new XmlTextWriter(Server.MapPath("/Home/data.xml"), //生成XML
         Encoding.GetEncoding("utf-8"));//设置encoding类型为:utf-8
        xtw.WriteRaw("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
        mydsClone.WriteXml(xtw);
        xtw.Close();
两种将dataset写入到xml的方法. 第二种方式可按指定的字符集格式存储!