private void CreateNewXmlNode() { String strFileName = string.Empty; strFileName = this.strCurrentPath + "System.xml"; XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load(strFileName); XmlNode root = xmlDoc.SelectSingleNode("connect"); XmlElement xe1 = xmlDoc.CreateElement("Data2"); XmlElement xesub1 = xmlDoc.CreateElement("ServerType"); xesub1.InnerText = "SQLSERVER"; xe1.AppendChild(xesub1); xesub1 = xmlDoc.CreateElement("Server"); xesub1.InnerText = "192.168.0.150"; xe1.AppendChild(xesub1); xesub1 = xmlDoc.CreateElement("database"); xesub1.InnerText = "VirDinnerOfflineDB"; xe1.AppendChild(xesub1); xesub1 = xmlDoc.CreateElement("UserID"); xesub1.InnerText = "sa"; xe1.AppendChild(xesub1); xesub1 = xmlDoc.CreateElement("Password"); xesub1.InnerText = "1234"; xe1.AppendChild(xesub1); root.AppendChild(xe1); xmlDoc.Save(strFileName); } catch(Exception ex) { MessageBox.Show(ex.Message); return; } }