F
Flyguy
Please help me figure out what is going wrong. I am getting an error when
trying to update a record using a datagrid control. My datagrid control is
modifying data from an XML file.
The XML file contains the following data:
<?xml version="1.0" encoding="utf-8" ?>
<users>
<user id ="aSmith" password="test1"/>
<user id ="tjones" password="test2"/>
</users>
The aspx file contains the following code:
<%@ 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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3" CellSpacing="1"
DataSourceID="UsersXmlDataSource" GridLines="None">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Button" ShowEditButton="True" />
<asp:BoundField DataField="id" HeaderText="id"
SortExpression="id" />
<asp:BoundField DataField="password" HeaderText="password"
SortExpression="password" />
</Columns>
<PagerStyle BackColor="#C6C3C6" ForeColor="Black"
HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True"
ForeColor="#E7E7FF" />
</asp:GridView>
<asp:XmlDataSource ID="UsersXmlDataSource" runat="server"
DataFile="~/App_Data/Users.xml">
</asp:XmlDataSource>
</div>
</form>
</body>
</html>
The error that is thrown is the following:
Specified method is not supported.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NotSupportedException: Specified method is not
supported.
trying to update a record using a datagrid control. My datagrid control is
modifying data from an XML file.
The XML file contains the following data:
<?xml version="1.0" encoding="utf-8" ?>
<users>
<user id ="aSmith" password="test1"/>
<user id ="tjones" password="test2"/>
</users>
The aspx file contains the following code:
<%@ 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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px"
CellPadding="3" CellSpacing="1"
DataSourceID="UsersXmlDataSource" GridLines="None">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Button" ShowEditButton="True" />
<asp:BoundField DataField="id" HeaderText="id"
SortExpression="id" />
<asp:BoundField DataField="password" HeaderText="password"
SortExpression="password" />
</Columns>
<PagerStyle BackColor="#C6C3C6" ForeColor="Black"
HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True"
ForeColor="#E7E7FF" />
</asp:GridView>
<asp:XmlDataSource ID="UsersXmlDataSource" runat="server"
DataFile="~/App_Data/Users.xml">
</asp:XmlDataSource>
</div>
</form>
</body>
</html>
The error that is thrown is the following:
Specified method is not supported.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NotSupportedException: Specified method is not
supported.