you can work with DataSet with a lot of controls, include the infragistics XamDataGrid and the DataGrid controls.
DataSet has this ReadXml method to allow you to read data from Xml, so that you can use an xml as the datasource, below shows an example of how construct DataSet with Xml.
public static string xmlString2 = @"<DataRowList>
<DataRow>
<TradeDate>Data</TradeDate>
<TradeType>Type</TradeType>
</DataRow>
<DataRow>
</DataRow>
</DataRowList>
";
DataSet dataset = new DataSet();
XmlReader xmlReader = XmlReader.Create(new StringReader(xmlString2));
dataset.ReadXml(xmlReader);
DataView dv = dataset.Tables[0].DefaultView;
xamDatagrid.DataSource = dv;
As from the DataSet.ReadXml documentation, you may find there is a ReadSchema call, (while ReadXml support reading both the xml and the schema at once).
More details on the DataSet schema is yet to come.
使用XML构造DataSet
本文介绍如何利用XML数据构造DataSet,并展示了具体的代码实现过程。通过使用DataSet的ReadXml方法,可以轻松地从XML文件中读取数据并填充到DataSet中。此外,还提到了ReadXml方法支持同时读取数据和模式。
4342

被折叠的 条评论
为什么被折叠?



