日期:2014-05-17 浏览次数:20723 次
public string CDataToXml(DataTable dt)
{
if (dt != null)
{
MemoryStream ms = null;
XmlTextWriter XmlWt = null;
try
{
ms = new MemoryStream();
//根据ms实例化XmlWt
XmlWt = new XmlTextWriter(ms, Encoding.Unicode);
//获取ds中的数据
dt.WriteXml(XmlWt);
int count = (int)ms.Length;
byte[] temp = new byte[count];