xml转换成模型层中表
我有1个xml文档,我想将其中数据插入数据库,通过模型层的对象来实现,因为一个节点相当于1个表
xml文档:
<books>
<book>
<aut>aaa </aaa>
<Createtime>2009 </Createtime>
</book>
<book>
<aut>aaa </aaa>
<Createtime>2009 </Createtime>
</book>
<book>
<aut>aaa </aaa>
<Createtime>2009 </Createtime>
</book>
</books>
Model中book
public class book
{
private string aut;
private datetime Createtime;
public string aut
{
get{return aut};
set{aut=value};
}
public datetiem Createtime
{
get{return Createtime};
set{Createtime=value};
}
public book(int aut,datetime Createtiem)
{
this.aut=aut;
this.Createtime=Createtime;
相关问答:
今天遇到一个问题,把xml中的值装到.txt格式的文件中。
我目前想到两种比较笨的方法:1.可以通过xmlspy编辑工具实现
2.通过把xml转成Javabean,然后转到excel中,再从新保存重命名为. ......
如何对xml内容数据进行比较
例如:
<?xml version='1.0' encoding='utf-8'?>
<TestLIST>
<PID>40</PID>
<TestName>深圳市</TestName>
......
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>这个是汉字</msg>
<serialno>123</serialno>
</root>
如何用ASP读取 status值 ......
string b = "";
b = System.Guid.NewGuid().ToString();//获得会话ID
//写XML
XmlDocument xml = new XmlDocumen ......