没有合适的资源?快使用搜索试试~ 我知道了~
sql server 中如何将表导出来放入Excel中
4星 · 超过85%的资源 需积分: 10 31 下载量 188 浏览量
2010-06-25
09:12:15
上传
评论
收藏 19KB TXT 举报
温馨提示
试读
17页
sql server 中如何将表导出来放入Excel中,你会不,不会就看看,我花了很长时间总结出来的,到20 个字没 差不多了吧
资源推荐
资源详情
资源评论
例二:需要在服务器上进行配置,但实现的功能强大.
具体的配置过程如下:
1:在服务器上安装Excel.
2:文件工作目录everyone用户必须拥有修改的权限.
3:在web.config文件中加入:
<system.web>
.......//其它配置信息
<identity impersonate="true"/>
.......//其它配置信息
</system.web>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Reflection;
using Microsoft.Office.Core;
/// <summary>
具体的配置过程如下:
1:在服务器上安装Excel.
2:文件工作目录everyone用户必须拥有修改的权限.
3:在web.config文件中加入:
<system.web>
.......//其它配置信息
<identity impersonate="true"/>
.......//其它配置信息
</system.web>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Reflection;
using Microsoft.Office.Core;
/// <summary>
/// OutPutExcel 的摘要说明
/// </summary>
public class OutPutExcel
{
public OutPutExcel()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//设置文件的名称属性.
private string _xfileName;
public string xFileName
{
get { return _xfileName; }
set { _xfileName = value; }
}
public void OutputExcel(DataView dv, string titleStr,string sheetName)
{
GC.Collect();
Excel.Application excel;// = new Application();
int rowIndex = 4;
int colIndex = 0;
Excel._Workbook xBk;
Excel._Worksheet xSt;
excel = new Excel.ApplicationClass();
/// </summary>
public class OutPutExcel
{
public OutPutExcel()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//设置文件的名称属性.
private string _xfileName;
public string xFileName
{
get { return _xfileName; }
set { _xfileName = value; }
}
public void OutputExcel(DataView dv, string titleStr,string sheetName)
{
GC.Collect();
Excel.Application excel;// = new Application();
int rowIndex = 4;
int colIndex = 0;
Excel._Workbook xBk;
Excel._Worksheet xSt;
excel = new Excel.ApplicationClass();
剩余16页未读,继续阅读
资源评论
- niro_z2013-02-02还不错,有用处,有参考性
chengjunwei0927
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功