私はXMLファイルを持っています:
<Database>
<SMS>
<Number>+447761692278</Number>
<DateTime>2009-07-27T15:20:32</DateTime>
<Message>Yes</Message>
<FollowedUpBy>Unassigned</FollowedUpBy>
<Outcome></Outcome>
<Quantity>0</Quantity>
<Points>0</Points>
</SMS>
<SMS>
<Number>+447706583066</Number>
<DateTime>2009-07-27T15:19:16</DateTime>
<Message>STOP</Message>
<FollowedUpBy>Unassigned</FollowedUpBy>
<Outcome></Outcome>
<Quantity>0</Quantity>
<Points>0</Points>
</SMS>
</Database>
現在、これを使用してdatagridviewに読み込みました。
public void Read()
{
DataSet ds = new DataSet("SMS DataSet");
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml(@"C:\Documents and Settings\Administrator\Desktop\RecSmsDB.xml");
ds = xmlDatadoc.DataSet;
this.dataGridView1.DataSource = ds;
this.dataGridView1.DataMember = "SMS";
this.dataGridView1.Sort(dataGridView1.Columns["DateTime"], ListSortDirection.Descending);
}
特定のDateTimeを持つxmlオブジェクトのみを読み取れるようにしたい。誰かがこれを行う方法を知っていますか?現在、名前空間に含まれているさまざまなメソッドを試しましたが、役に立ちませんでした。
非常に感謝します、
よろしく。
***編集:実行時に表示されるデータを動的に変更できるようにしたい。