使用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);
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);