// 读取xml文件到DataTable
string filepath = Application.StartupPath + @"\Previous Competitions\PreviousCompetitions.xml";
if (!File.Exists(filepath))
{
MessageBox.Show("File is not exist!");
return;
}
try
{
DataSet ds = new DataSet();
ds.ReadXml(filepath);
this.dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show("Loaddata Filed!Message:"+ex.Message.ToString());
return;
}