简单无限级树 生成XML代码
- 作者:xiaoxiao
- 发表时间:2020-12-23 11:00
- 来源:未知
???????? private ? void ?makeXml( string ?xmlPath)???????? {????????????string?sqlStr?=?"SELECT?*?FROM?tree?ORDER?BY?treenode";????????????OleDbDataAdapter?da?=?new?OleDbDataAdapter(sqlStr,?conn);????????????DataTable?dt?=?new?DataTable();????????????da.Fill(dt);????????????da.Dispose();????????????int?ptreeDepth?=?-1;????????????int?treeDepth?=?0;????????????XmlTextWriter?xw?=?new?XmlTextWriter(xmlPath,?null);????????????xw.Formatting?=?Formatting.Indented;????????????xw.IndentChar?=?' ';????????????xw.Indentation?=?1;????????????xw.WriteStartDocument();????????????xw.WriteStartElement("treeRoot");????????????