DataSet¡¢Excel¡¢XMLÖ®¼äµÄµ¼Èëµ¼³ö
class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFileDlg = new System.Windows.Forms.SaveFileDialog();
public ImportExportToExcel()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
this.openFileDlg.DefaultExt = "xls";
this.openFileDlg.Filter = "ExcelÎļþ (*.xls)|*.xls";
this.saveFileDlg.DefaultExt = "xls";
this.saveFileDlg.Filter = "ExcelÎļþ (*.xls)|*.xls";
}
#region ´ÓExcelÎļþµ¼Èëµ½DataSet
/**/
/// <summary>
/// ´ÓÑ¡ÔñµÄExcelÎļþµ¼Èë
/// </summary>
/// <returns>DataSet</returns>
public DataSet ImportfromExcel()
{
DataSet ds = new DataSet();
if (openFileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
ds = doImport(openFileDlg.FileName);
return ds;
}
/**/
/// <summary>
/// ´ÓÖ¸¶¨µÄExcelÎļþµ¼Èë
/// </summary>
/// <param name="strFileName">ExcelÎļþÃû</param>
/// <returns></returns>
public DataSet ImportfromExcel(string strFileName)
{
DataSet ds = new DataSet();
ds = doImport(strFileName);
return ds;
}
/**/
/// <summary>
/// Ö´Ðе¼Èë
/// </summary>
/// <param name="strFileName">ÎļþÃû</param>
/// <returns>
Ïà¹ØÎĵµ£º
http://www.cnblogs.com/long2006sky/articles/1258731.html
DataSetת»»ÎªxmlÎļþ
//½«DataSetת»»ÎªxmlÎļþ
private static void ConvertDataSetToXMLFile(DataSet xmlDS, string xmlFile)
{
&n ......
Èç¹û¶Ô½çÃæÃÀ¹Û³ÌÐò±È½Ï¸ß£¬ÊÖд´úÂëÊDz»¿É±ÜÃâµÄ¡£
µ«Èç¹û×öµÄÊÇһЩÏñÖ»ÊÇΪÁËÏÔʾ¡¢¿ØÖÆÖ®ÀàµÄ³ÌÐò£¬¿ÉÄܸü¿ìµÄ°Ñ³ÌÐòµ·¹Ä³öÀ´¾ÍºÃÁË¡£
wxwidgets
ÓÐÕâÑùµÄÒ»¸ö¹¦ÄÜ£¬¾ÍÊÇÄÜÓÃxmlд³É½çÃæ¾ÍÄÜÏÔʾ
±à¼xrcµÄ¹¤¾ßÊÇwxformbuilder,¿ªÔ´Ãâ·ÑµÄ£¬Ò²×ã¹»ÓÃÁË£¬ÎÒÒ»¿ªÊ¼Ã»ÕÒµ½Ôõô
Éú³Éxrc,ºóÀ´Ä³´ÎżȻ¿´µ½ÁËÏÂÃæ....ÔÀ ......
ÔÚXMLÎļþÖжÁÈ¡ÊôÐÔÎļþ£¨.properties£©ÖеÄÔªËØÖµ£º
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/dataAccessContext.xml</param-value>
</context-param>
<listener>
<listener-class>
......
Çë¿´ÏÂÃæµÄʾÀý£º
<person sex="female">
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person>
<person>
<sex>female</sex>
<firstname>Anna</firstname>
<lastname>Smith</lastname>
</person> ......