Put xml node list to datasethttp://forums.asp.net/t/1800208.aspx/1?Put+xml+node+list+to+datasetTue, 08 May 2012 08:41:07 -040018002084965932http://forums.asp.net/p/1800208/4965932.aspx/1?Put+xml+node+list+to+datasetPut xml node list to dataset <p>Hi programmers,</p> <p>I have an xmlNodeList object called xmlMatchedTeams, and I want to put it into a dataset, I have tried the following and get and error anyone got any ideas below is my c# code:</p> <pre class="prettyprint">XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(filePath); xmlMatchedTeams = xmldoc.SelectNodes(&quot;//MatchList/Match/Teams/Team&quot;); foreach (XmlNode teams in xmlMatchedTeams) { xmldoc.LoadXml(teams.OuterXml); if (TeamHsh.Count != 2) { TeamHsh.Add(teams.Attributes[&quot;teamId&quot;].Value, teams.SelectSingleNode(&quot;LongName&quot;).InnerText); } } return TeamHsh; } public DataSet test() { ds = new DataSet(); ds.ReadXml(xmlMatchedTeams); return ds; }</pre> <p><br> <br> </p> 2012-05-04T15:37:59-04:004970442http://forums.asp.net/p/1800208/4970442.aspx/1?Re+Put+xml+node+list+to+datasetRe: Put xml node list to dataset <p>Hi,</p> <p>Refer this sample:</p> <p><a href="http://aspdotnetcodebook.blogspot.com/2008/04/how-to-convert-xmlnodelist-to-datatable.html">http://aspdotnetcodebook.blogspot.com/2008/04/how-to-convert-xmlnodelist-to-datatable.html</a></p> <p>Thanks,</p> 2012-05-08T08:41:07-04:00