Hi All,
I have written a procedure in C#.Net for updating an xml node. I am using VS2008 with Dot Net Framework 3.5
I am submitting my code in below
Now What the problem is, it throws an error "Object reference not set". I don't know exactly why and where the error occurs
With Regards
Vijay. R
I have written a procedure in C#.Net for updating an xml node. I am using VS2008 with Dot Net Framework 3.5
I am submitting my code in below
Code:
private void updateNodeValue(string nodename, string nodevalue, string strfilepath) { try { XmlDocument xd1 = new XmlDocument(); xd1.Load(strfilepath); string selnode = xmlnodepath + "/" + nodename; XmlNode nod1 = xd1.SelectSingleNode(selnode); nod1.InnerText = nodevalue; xd1.Save(strfilepath); MessageBox.Show("Successfully Updated"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
Now What the problem is, it throws an error "Object reference not set". I don't know exactly why and where the error occurs
With Regards
Vijay. R
Comment