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>
&
相关文档:
--本文摘自http://www.moandroid.com/?p=508
By: 海市蜃楼 | In: Android开发
3 九 2009
XML 经常用作 Internet 上的一种数据格式,其文件格式想必大家都比较清楚,在这里我结合Android平台,来说明Android SDK提供的读写XML的package。
首先介绍下Android SDK与Java SDK在读写XML文件方面,数据包之间的关系。Android ......
创建文档类型声明
一般而言,XML声明放在文档顶部。在PHP中声明十分简单:只需实例化一个DOM文档类的对象并赋予它一个版本号。查看程序清单A:
程序清单 A
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// display document in browser as plain text ......
http://stackoverflow.com/questions/1112828/cannot-decode-string-with-wide-characters-appears-on-a-weird-place
http://man.ddvip.com/web/xmlzhzn/xml_cn/xml_encoding.asp.htm
http://bbs.xml.org.cn/dispbbs.asp?boardID=8&ID=7226
http://topic.csdn.net/t/20030909/13/2240153.html
#
http://www.ezloo. ......
1 在Action实现类方面的对比:Struts 1要求Action类继承一个抽象基类;Struts 1的一个具体问题是使用抽象类编程而不是接口。Struts 2 Action类可以实现一个Action接口,也可以实现其他接口,使可选和定制的服务成为可能。Struts 2提供一个ActionSupport基类去实现常用的接口。即使Action接口不是必须实现的,只有一 ......