Reading XML string into datatable


string str= "<NewDataSet> <Table1> <ID>1</ID> <Name>Tarun</Name> <Alias /> <Alias2 /> <Action>Add</Action> </Table1> <Table1> <ID>2</ID> <Name>Rahul</Name> <Alias /> <Alias2 /> <Action>Add</Action></Table1></NewDataSet>"


DataSet ds = new DataSet();
ds.ReadXml(new StringReader(str));
DataTable table1 = ds.Tables["Table1"];
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment