第一种方法较慢,但是数据格式都比较好,需要引用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…
* 说明:复制表(只复制结构,源表名:a 新表名:b) select * into b from a where 1<>1 * 说明:拷贝表(拷贝数据,源表名:a 目标表名:b) insert into b(a, b, c) select d,e,f from b; * 说明:显示文章.提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max(adddate) adddate…