DataTable dt = new DataTable(); public void SyncWIthConfigFile() { initialXmlDoc(); XmlElement rootElement = xmlCommand.DocumentElement; UFCCommand command = new UFCCommand(); foreach (XmlNode childNode in rootElement.ChildNodes) { List<ufccommand> commandList = new List<ufccommand>(); DataRow dr = dt.NewRow(); if (childNode.Name != "_ERD" && childNode.Name!="_DLY") { command.Name = childNode.Name; dr["ColName"] = command.Name.ToString(); if (childNode.FirstChild.Name == "SET_RESPONSE") { command.SetValue = childNode.FirstChild.InnerText; dr["ColSetValue"] = command.SetValue.ToString(); } if(childNode.LastChild.Name=="GET_RESPONSE") { command.GetValue = childNode.LastChild.InnerText; dr["ColGetValue"] = command.GetValue.ToString(); } dataGridView1.DataSource = dt; } } }</ufccommand></ufccommand>
"Column 'ColName' does not belong to table ."
dt.Columns[0].ColumnName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)