ASP.Net 删除xml文件中的数据(delete操作)
XML文件请见ASP.Net中实现XMl的标识列(ID列)或自增长列
代码如下:
删除按钮事件:
代码如下:
删除按钮事件:
private void Btn_Delete_Click(object sender, System.EventArgs e)
{
string uid = Session["uid"]//取得主键;
string [] values = {uid};
OperateXmlByDataSet.DeleteXmlRows(ViewState["filename"].ToString(),"userid",values); }
OperateXmlByDataSet的DeleteXmlRow方法:{
string uid = Session["uid"]//取得主键;
string [] values = {uid};
OperateXmlByDataSet.DeleteXmlRows(ViewState["filename"].ToString(),"userid",values); }
DeleteXmlRows
作者:青羽