列车时刻查询系统(北大青鸟大二寒假作业) 源代码(七)
2008-01-23 22:05
344 查看
导入数据类,主要包括导入XML数据
using System;
using System.Data;
using System.Windows.Forms;
namespace train
...{
/**//// <summary>
/// ImportData :导入数据
/// </summary>
public class ImportData
...{
private DataSet ds;
private DataTable table;
public ImportData()
...{
ds=new DataSet();
table=new DataTable();
}
/**//// <summary>
/// 从XML文件导入数据
/// </summary>
/// <returns>返回包含数据的DataTable</returns>
public DataTable ImportDataFromXml()
...{
OpenFileDialog dialog=new OpenFileDialog();
dialog.Filter="XML文件|*.xml";
dialog.ShowDialog();
string path=dialog.FileName;
if(path.Length==0)
...{
return null;
}
try
...{
ds.ReadXml(@path,XmlReadMode.Auto);
return ds.Tables[0];
}
catch(Exception e)
...{
Console.WriteLine(e.Message);
return null;
}
}
}
}
using System;
using System.Data;
using System.Windows.Forms;
namespace train
...{
/**//// <summary>
/// ImportData :导入数据
/// </summary>
public class ImportData
...{
private DataSet ds;
private DataTable table;
public ImportData()
...{
ds=new DataSet();
table=new DataTable();
}
/**//// <summary>
/// 从XML文件导入数据
/// </summary>
/// <returns>返回包含数据的DataTable</returns>
public DataTable ImportDataFromXml()
...{
OpenFileDialog dialog=new OpenFileDialog();
dialog.Filter="XML文件|*.xml";
dialog.ShowDialog();
string path=dialog.FileName;
if(path.Length==0)
...{
return null;
}
try
...{
ds.ReadXml(@path,XmlReadMode.Auto);
return ds.Tables[0];
}
catch(Exception e)
...{
Console.WriteLine(e.Message);
return null;
}
}
}
}
相关文章推荐
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(一)
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(二)
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(六)
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(三)
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(八)--终结篇
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(四)
- 列车时刻查询系统(北大青鸟大二寒假作业) 源代码(五)
- 列车时刻查询系统(大二---北大青鸟寒假作业寒假作业)
- 由列车时刻查询系统想到的...
- 电子地图查询系统_v1.0_源代码(VB6+MAPX5)
- p2p聊天系统(北大青鸟大二寒假作业)
- JSP+Servlet培训班作业管理系统[19] -完结篇之前端源代码
- 春运列车时刻查询
- MS-SQL数据库系统表的总结与应用(查询作业等)
- 最新全国火车列车时刻查询数据库20090309下载
- 自己做列车查询系统得到的一点知识,只求以后好自己看
- ASP.NET域名查询系统源代码,域名Whois查询,(.Com/.Net/.Org/.Cn),c#语言实现域名Whois信息查询
- 列车时刻表查询系统
- 3.第三单元任务二实训:使用作业提交系统提交Java作业时 ,需要输入Java源代码文件名和自己的邮箱,提交前对Java文件名以及邮箱进行有效检查。编写程序实现对输入的Java源文件名以及邮箱有效性的
- 通过查询Android系统setting源代码掌握如何获取SD卡大小和可用空间