public ArrayList Form_data = new ArrayList(); public struct Form_attr { public string OID; public string Name; public string repeating; }; public frmMain() { InitializeComponent(); load_XML(); } public void load_XML() { Form_attr fa; try { XmlTextReader reader = new XmlTextReader("updated.xml"); while (reader.Read()) { if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "FormDef")) { if (reader.HasAttributes) { fa.OID = reader.GetAttribute("OID"); fa.Name = reader.GetAttribute("Name"); fa.repeating = reader.GetAttribute("Repeating"); Form_data.Add(fa); } } /* else if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "FormDef"))*/ } } catch (Exception e) { MessageBox.Show(e.Message); } finally { } for (int i = 0; i < Form_data.Count; i++) { Form_attr test = (Form_attr)Form_data[i]; Console.WriteLine("Form OID--> "+test.OID+" Name==>"+test.Name+" Repeating-->"+test.repeating ); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)