{"id":5407,"date":"2014-03-30T21:39:35","date_gmt":"2014-03-30T21:39:35","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/editing-function-for-an-xml-gridview-in-asp-net-collection-of-common-programming-errors\/"},"modified":"2014-03-30T21:39:35","modified_gmt":"2014-03-30T21:39:35","slug":"editing-function-for-an-xml-gridview-in-asp-net-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/editing-function-for-an-xml-gridview-in-asp-net-collection-of-common-programming-errors\/","title":{"rendered":"Editing function for an XML Gridview in ASP.NET-Collection of common programming errors"},"content":{"rendered":"<p>I want to write, update or edit a function for an XML gridview in ASP.net (in visual studio 2010), but I don&#8217;t know which action I should use?<\/p>\n<p>This is my code but it doesn&#8217;t work. When I click edit on the gridview an exception occured:<\/p>\n<pre><code> private DataSet ds;\n    DataRow r;\n    protected void Page_Load(object sender, EventArgs e)\n    {\n        ds = new DataSet();\n        ds.ReadXml(Server.MapPath(\"..\/web.config\"));\n        GridView1.DataSource = ds.Tables[\"user\"];\n        GridView1.DataBind();\n\n    }\n    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)\n    {\n        GridView1.EditIndex = e.RowIndex;\n        GridView1.DataBind();\n    }\n\n    protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)\n    {\n\n        r = ds.Tables[\"user\"].Rows[e.AffectedRows];\n        r[\"password\"] = FormsAuthentication.HashPasswordForStoringInConfigFile(GridView1.SelectedRow.Cells[1].ToString(), \"MD5\");\n\n\n        ds.AcceptChanges();\n        ds.WriteXml(Server.MapPath(\"web.config\"));\n        GridView1.DataBind();\n    }\n<\/code><\/pre>\n<p>thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I want to write, update or edit a function for an XML gridview in ASP.net (in visual studio 2010), but I don&#8217;t know which action I should use? This is my code but it doesn&#8217;t work. When I click edit on the gridview an exception occured: private DataSet ds; DataRow r; protected void Page_Load(object sender, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5407","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5407"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5407\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}