I'm trying to turn the xml below into a dataset / datatable so I can display it in a gridview but it's returning 0 tables? Anythoughts?
Hello:)
I think you should simplify your root tag to only one,and you can use DataSet.ReadXml to import the whole xml contents into a DataTable by referring its public property of——DataSet.Tables[0],please check this out:
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: DataSet.XMLRead not making any tables
May 25, 2012 01:27 AM|LINK
Hello:)
I think you should simplify your root tag to only one,and you can use DataSet.ReadXml to import the whole xml contents into a DataTable by referring its public property of——DataSet.Tables[0],please check this out:
<configuration> <user> <name>joeuser</name> <uid>2001</uid> <class>xyz</class> <authentication>askldjfc;acmealsiefja;flcnsdlkm</authentication> </user> <user> <name>bobuser</name> <uid>2002</uid> <class>xyz</class> <authentication>your value2</authentication> </user> <user> <name>joeuser</name> <uid>2002</uid> <class>xyz</class> <authentication>your value3</authentication> </user> </configuration>And here's your code contents:
DataSet ds = new DataSet() ds.ReadXml("c:\\xxx.xml")