<tables>
<row>
<table_name>ticket</table_name>
<record_key>68</record_key>
</row>
<row>
<table_name>sales</table_name>
<record_key>3001</record_key>
</row>
</tables>
how can i load a datatable with above xml string

how to load datatable with xml
Nick Darnell
How do we put the xml
<
a loan="1"><
b Payee="A" amt="300" /><
b Payee="B" amt="409" /><
b Payee="C" amt="390" /></
a><
a loan="2"><
b Payee="A" amt="200" /><
b Payee="B" amt="450" /><
b Payee="C" amt="300" /></
a>into a datatable
SAM
Laxmi.
Rob Grunkemeyer
tonhinbm
you could use a StringReader to read the xml from the string into the dataset. Using your example, this works for me:
string theXmlString = "<tables><row><table_name>ticket</table_name><record_key>68</record_key></row><row>";
theXmlString += "<table_name>sales</table_name><record_key>3001</record_key></row></tables>"; //you can put these 2 lines in one, this was just for formatting issues here on the reply
StringReader theReader = new StringReader(theXmlString);
DataSet theDataSet = new DataSet();
theDataSet.ReadXml(theReader);
//Data will be stored in Table[0]:
this.theDataGridView.DataSource = theDataSet.Tables[0].DefaultView;
does this help
martona
you could load the xml into a dataset:
DataSet theDataSet = new DataSet();
theDataSet.ReadXml("XMLfile");
does this help