如何将数据库中数据源生成xml文件 sql server
发布网友
发布时间:2022-04-19 22:21
我来回答
共2个回答
热心网友
时间:2022-04-08 03:04
List<Area> list = a.GetAllAreaById(id);
//将list集合序列化到流中
MemoryStream stream = new MemoryStream();
XmlSerializer s = new XmlSerializer(typeof(List<Area>));
s.Serialize(stream, list);
//将流转换成字节数组,再解码为字符串
string ss = System.Text.Encoding.UTF8.GetString(stream.ToArray());
XmlDocument dom = new XmlDocument();
dom.LoadXml(ss);
Response.ContentType = "text/xml";
Response.Charset = "utf-8";
HttpContext.Current.Response.Write(dom.OuterXml);
热心网友
时间:2022-04-08 04:22
xml --> sql server
http://community.csdn.net/Expert/topic/5041/5041228.xml?temp=.8233911