특정 노드 :C#을 윈폼 읽기 XML 파일 - 내가 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 개체 누구든지이 일을하는 방법을 알고 있습니까? 현재 네임 스페이스에 포함 된 다양한 방법을 시도했지만 아무 소용이 없습니다.
크게 도움을 주시면 감사하겠습니다.
*** 편집 : 런타임에 표시되는 데이터를 동적으로 변경할 수 있어야합니다.
+1 동의. 데이터가 엄청나게 큰 것이 아니라면 DataSet에서 필터링하면됩니다. –