【发布时间】:2012-04-03 04:36:52
【问题描述】:
朋友们, 我的学校项目有一个 xml 数据文件:
<patients>
<patient>
<regNo>2012/Mar/003</regNo>
<name>Jhon</name>
<add>Somewhere</add>
<mobile>0000</mobile>
.
.
.
<stay>2</stay>
<costofroom>100</costofroom>
<total>200</total>
</patient>
</patients>
我的 Windows 表单“EditPatients_Load”能够获取患者 Jhon 的所有信息,现在假设管理员需要更改表单中的一些信息并重新提交。
然后如何在同一个xml中将所有值写回Jhon的帐户 文件????
我无法编写逻辑代码,即使我检查节点 if (patients.paptient.name = "nameComboBox.text").... 如何确保我正在写其他值合适的地方?
Rgrdz,
【问题讨论】:
-
how to make sure that I'm writing other values on proper place是什么意思?你能改写一下吗? -
写入写入位置是什么意思,您可以通过替换值来更新文件添加新数据或重写文件,在这种情况下,它将是具有更多数据的同一个文件
-
抱歉回复晚了:我的意思是如何确保所有 winform 值的提交都会更新到特定的子节点(Jhon 的帐户)。 Bcoz 为了保持 xml 布局简单,我做了一个简单的:Root/parent then child1, child2, child3.... 节点布局