将数据库中的数据导出为excel文件,供其他人查看 public class POITest { public static void main(String[] args) { POITest test = new POITest(); // test.readExcelToDB(); test.writeExcelFromDB(); } static class Book{ public String title; public String author; public String da…
第一种方法较慢,但是数据格式都比较好,需要引用excel的 Microsoft.Office.Interop.Excel.dll office.dll #Region "导出excel函数" Public Sub DcExcel(ByVal DGV As DataGridView) '把datagridview中的数据导出到excel Dim wapp As New Microsoft.Office.Interop.Excel.Application …
using System; using System.IO; using System.Data; using System.Collections; using System.Data.OleDb; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; /// <summary> /// Excel操作类 /// </summary> /// Microsoft Excel 11.0 Obj…