日期:2014-04-12 浏览次数:20928 次
XML文件:
<?xml version="1.0" standalone="yes"?>
<XmlDataSet>
<UserInfo>
<Id>1</Id>
<Name>赵AX</Name>
</UserInfo>
<UserInfo>
<Id>2</Id>
<Name>钱BB</Name>
</UserInfo>
<UserInfo>
<Id>3</Id>
<Name>孙CC</Name>
</UserInfo>
<UserInfo>
<Id>4</Id>
<Name>李DY</Name>
</UserInfo>
<UserInfo>
<Id>5</Id>
<Name>周EF</Name>
</UserInfo>
<UserInfo>
<Id>6</Id>
<Name>吴FF</Name>
</UserInfo>
<UserInfo>
<Id>7</Id>
<Name>郑GG</Name>
</UserInfo>
</XmlDataSet>前台代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteDataSet"
InsertMethod="InsertDataSet" SelectMethod="GetDataSet" TypeName="UserInfoTable"
UpdateMethod="UpdateDataSet">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Id" Type="Int32" />
<asp:Parameter Name="Name" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Name" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
</div>
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
</Columns>
&nb