private void WriteToItemDataset(string ItemNo) { DataSet ds = new DataSet(); DataTable dt = new DataTable("Items"); if (Session["dtItemData"] != null) { dt = (DataTable)Session["dtItemData"]; } if (ItemNo != string.Empty) { foreach (DataRow row in dt.Rows) { if (!Convert.ToBoolean(row["DeletedFlag"])&& ItemNo == Convert.ToString(row["ItemNo"])) { row["ItemDescription"] = Editor3.Value; dt.AcceptChanges(); break; } } DataView dv = dt.DefaultView; dv.Sort = "DeletedFlag,ItemNo"; Session["dtItemData"] = dt; string Filepath = Server.MapPath("~/CorporateCharities_Content.xml"); if (File.Exists(Filepath)) { dt.WriteXml(Filepath,true); this.errorMessageHtmlCell.Attributes.Add("style", "color:Green"); this.errorMessageHtmlCell.InnerText = "Record(s) saved successfully."; } else { this.errorMessageHtmlCell.Attributes.Add("style", "color:Red"); this.errorMessageHtmlCell.InnerText = "File Not Found."; } protected void Submit_Click(object sender, EventArgs e) { string ItemNo = Convert.ToString(Session["EditValue"]); this.WriteToItemDataset(ItemNo); this.errorMessageHtmlCell.InnerText = "Record(s) saved successfully."; //+ ItemNo; this.errorMessageHtmlCell.Attributes.Add("style", "color:Green"); BindDataLIst(); Editor3.Value = ""; trMsgContent.Visible = true; trEditorMsg.Visible = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)