XML文件绑定数据集控件操作
//数据绑定
public void DataBind()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
//添加
public void XmlDataAdd()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
DataRow dr = ds.Tables[0].NewRow();
dr["Name"] = "spark";
dr["City"] = "tokyo";
dr["Email"] = "jis@163.com";
dr["Message"] = "thank you";
dr["STime"] = DateTime.Now.ToString();
ds.Tables[0].Rows.Add(dr);
ds.WriteXml(Server.MapPath(@"App_data/dbGuest.xml"));
}
dbGuest.xml
<?xml version="1.0" standalone="yes"?>
<dbGuest xmlns="http://tempuri.org/dbGuest.xsd">
<User>
<Name>shaoazhd</Name>
<City>beijing</City>
<Email>sss@22.net</Email>
<Message>afsa</Message>
</User>
<User>
&
相关文档:
xml_parse解析xml文件时候,
很有可能不仅仅调用一次character_handler。
所以在获得xml节点的文本信息的时候,要用连接运算".="。
参考 http://jp2.php.net/manual/ro/function.xml-set-character-data-handler.php
ken at positive-edge dot com
30-Jan-2002
01:20
the function handler is called ......
1 在Action实现类方面的对比:Struts 1要求Action类继承一个抽象基类;Struts 1的一个具体问题是使用抽象类编程而不是接口。Struts 2 Action类可以实现一个Action接口,也可以实现其他接口,使可选和定制的服务成为可能。Struts 2提供一个ActionSupport基类去实现常用的接口。即使Action接口不是必须实现的,只有一 ......
[System.Runtime.Serialization.DataMemberAttribute()]
public Information Archive {
get {
&n ......
本文首发代码天下,转载请注明来源代码天下,谢谢。
今天上班时遇到一个问题,游戏官反应一个用户充不了值。充不了值一般为用户角色不正确,我仔细检查发现该用户角色有点异常,因为对方返回角色是xml,我贴上来给大家看一下:
<Result value="true" message="Success!"> <It ......