----------VB.NET 导出数据到EXCEL中-------------
在引用当中引入Microsoft Excel 11.0 Object Library
Dim oExcel As New Excel.ApplicationDim obook As Excel.WorkbookDim oSheet As Excel.WorksheetDim DataArray(2000, 2000) As Integerobook = oExcel.Workbooks.Open("c:\1.xls")oSheet = obook.Worksheets(1)oSheet.Name = "ok"Dim myAdapter As New OleDb.OleDbDataAdapter("select * from list", Module1.dbConn)Dim mydataset As New DataSetmyAdapter.Fill(mydataset, "list")DataGrid1.DataSource = mydataset.Tables("list")Dim i As IntegerDi...[ 查看全文 ]