标签:returns UI stat ++ highlight append datatable name let
/// <summary> /// datatable转换xml /// </summary> /// <param name="xmlDS"></param> /// <returns></returns> public static string ConvertDataTableToXML(DataTable xmlDS) { StringBuilder strXml = new StringBuilder(); strXml.AppendLine("<MonitorData>"); for (int i = 0; i < xmlDS.Rows.Count; i++) { strXml.AppendLine("<" + xmlDS.TableName + ">"); for (int j = 0; j < xmlDS.Columns.Count; j++) { strXml.AppendLine("<" + xmlDS.Columns[j].ColumnName + ">" + xmlDS.Rows[i][j] + "</" + xmlDS.Columns[j].ColumnName + ">"); } strXml.AppendLine("</" + xmlDS.TableName + ">"); } strXml.AppendLine("</MonitorData>"); return strXml.ToString(); }
标签:returns UI stat ++ highlight append datatable name let
原文地址:http://www.cnblogs.com/ncellit/p/6955242.html