User1535942433 posted
Hi krisrajz,
Accroding to your description and codes,as far as I think,when you use dataset readxml method to read the file,it will create another tabel because of the repeat node base on the dependencies of dataset.So ,I suggest you could preloaded dataset to datatable
and set XmlReadMode to be auto or IgnoreSchema.
Besides,I suggest you best to use linq to xml.Duplicate nodes are not allowed in dataset.
More details,you could refer to below codes:
DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("ProfRegion", typeof(string));
dt.Columns.Add("ProfDGOffice", typeof(string));
dt.Columns.Add("ProfDGOrgUnit", typeof(string));
dt.Columns.Add("Approver_txt", typeof(string));
dt.Columns.Add("PA", typeof(string));
dt.Columns.Add("TimeStatus", typeof(string));
dt.Columns.Add("ProfCategory", typeof(string));
dt.Columns.Add("ProfType", typeof(string));
dt.Columns.Add("Exemptstatus", typeof(string));
dt.Columns.Add("NationalPractice", typeof(string));
dt.Columns.Add("TimePrd", typeof(string));
dt.Columns.Add("StartDate", typeof(string));
dt.Columns.Add("EndDate", typeof(string));
dt.Columns.Add("WebServerReportPath", typeof(string));
dt.Columns.Add("Prof_txt", typeof(string));
dt.Columns.Add("RequireFollowup", typeof(string));
dt.Columns.Add("ShowMissingTime", typeof(string));
dt.Columns.Add("ProfStatus", typeof(string));
ds.Tables.Add(dt);
ds.ReadXml(Server.MapPath("XMLFile4.xml"),XmlReadMode.IgnoreSchema);
DataTable dt = ds.Tables[0];
More details,you could refer to below article:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml-overview
Best regards,
Yijing Sun