このxml情報をテーブルに取得しようとしています。XMLをデータセットに読み込もうとしました...
string myXMLfile = @"..\..\..\BR7.xml";
//http://tatts.com/pagedata/racing/2011/10/5/BR7.xml
//http://tatts.com/racing/2011/10/5/BR/7
DataSet ds = new DataSet();
try
{
ds.ReadXml(myXMLfile);
for (int i = 0; i < ds.Tables.Count; i++)
{
listBox1.Items.Add(ds.Tables[i].TableName);
}
dgvRunner.DataSource = ds;
dgvRunner.DataMember = "Runner";
dgvWinOdds.DataSource = ds;
dgvWinOdds.DataMember = "WinOdds";
dgvPlaceOdds.DataSource = ds;
dgvPlaceOdds.DataMember = "PlaceOdds";
dgvFixedOdds.DataSource = ds;
dgvFixedOdds.DataMember = "FixedOdds";
しかし、私は4つの別々のテーブルを取得します。Runner、WinOdds、PlaceOdds、および fixedOdds Runner のすべての情報を単一のテーブルに取得するにはどうすればよいですか?
ここにいくつかのxmlがあります...
-<Runner RunnerNo="1" Rtng="93" LastResult="0X1" Form="W" Weight="57.0" Handicap="0" Barrier="10" RiderChanged="N" Rider="P SCHMIDT(A)" Scratched="N" RunnerName="PREACHER BOY">
<WinOdds CalcTime="2011-10-05T16:51:07" LastCalcTime="2011-10-05T16:46:32" Short="N" Lastodds="11.50" Odds="10.70"/>
<PlaceOdds Short="N" Lastodds="3.50" Odds="3.30"/>
-<FixedOdds RaceDayDate="2011-10-05T00:00:00" MeetingCode="BR" RaceNo="07" RunnerNo="01" LateScratching="0" Status="w" OfferName="PREACHER BOY" RetailPlaceOdds="3.3500" RetailWinOdds="12.0000" PlaceOdds="3.3500" WinOdds="12.0000" OfferId="981020"><Book SubEventId="863449" BookStatus="F"/>
</FixedOdds>
</Runner>