RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:9:30-18:00
你可能遇到了下面的问题
关闭右侧工具栏
简单无限级树 生成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");????????????