data tabel常用方法

来源:互联网 发布:柳州广电网络营业厅 编辑:程序博客网 时间:2024/05/24 04:18

  今天开始学习DataTable的常用用法,摘录如下:

   1. AddSheet method use to create the new sheet, the New sheet in the run-time data table and then adds a parameter to the new sheet。

   for example:

   DataTable.AddSheet("MySheet").AddParameter("Test","value")

  when execute this, then in the Test Result  Run-time Table will generate a new sheet named MySheet, and have a row name Test and the value is value.


 2. DeleteSheet
     DeleteSheet used to delete one sheet from the run-time datatable
  for example, follow the above example, add the DeleteSheet method
   DataTable.DeleteSheet("MySheet“) //then MySheet will be removed from the Run time table

3. Export
    Export method used to save a copy to a specific local
    for example:
    DataTable.Export("C:/flights.xls")
 
4.

原创粉丝点击