myDs.Dispose(); } </script> <html> <head> <title>插入一条数据</title> </head> <body> <form runat="server"> <table width="100%"> <tr> <td>写入前</td> <td>写入后</td> </tr> <tr> <td valign="top"><asp:DataGrid id="PreData" runat="server"/></td> <td valign="top"><asp:DataGrid id="NextData" runat="server"/></td> </tr> </table> </form> </body> </html> 通过上面的操作,我们将得到的XML结果如下: <users> <xs:schema id="users" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="users" msdata:IsDataSet="true" msdata:Locale="zh-CN"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="user"> <xs:complexType> <xs:sequence> <xs:element name="userName" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="userPass" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> </xs:sequence> <xs:attribute name="id" type="xs:string" /> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <user id="1"> <userName>outrace</userName> <userPass>mypass</userPass> </user> <user id="2"> <userName>trace</userName> <userPass>mypass</userPass> </user> <user id="3"> <userName>new user</userName> <userPass>new passwd</userPass> </user> |