使用DataSet.GetXml()返回值生成DataSet

服务端:
            DataSet ds = new CDACommon().GetDataSet(sSql,false);           
            System.Text.StringBuilder sb = new System.Text.StringBuilder();           
            System.Xml.XmlTextWriter xtw = new System.Xml.XmlTextWriter(new System.IO.StringWriter(sb));
            ds.WriteXml(xtw,XmlWriteMode.WriteSchema);
            return sb.ToString();

客户端:
                string sXml = ecall.GetSmsSubscriptions(Session["SupplierNo"].ToString(), "供应商", "自己订阅");
                System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
                xdoc.LoadXml(sXml);
                string sFileName = Server.MapPath(System.Guid.NewGuid().ToString()+".xml");
                xdoc.Save(sFileName);               
                DataSet ds = new DataSet("New DataSet");
                ds.ReadXml(sFileName,XmlReadMode.ReadSchema)
                System.IO.File.Delete(sFileName);

posted on 2008-07-15 14:23  DoNet鸟  阅读(1303)  评论(0编辑  收藏  举报

导航