C# 中导出Excel表格中,怎么实现啊.?

来源:百度知道 编辑:UC知道 时间:2024/06/14 09:11:10
我用的是DatagridView表显示数据.! 但是我想把dataGridView表中的数据

导出到Excel表中啊1.、要用到什么控件吗.? 麻烦说的详细点.!

--------------------------------------------------------------------
有源码那就更好啊1. 谢谢你们了.! 我在此感激不尽。。。

分不是很多,希望你们不要嫌少..

--------------------------------------------------------------------

我给你个源码
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;

namespace Property_management
{
class Export
{
private static System.Windows.Forms.DataGridView gridView;
private static System.Windows.Forms.ProgressBar toolStripProgressBar1;
private static Timer time;
private static DataSet objSet = new DataSet();
private static SaveFileDialog saveFileDialog = new SaveFileDialog();
private static SaveFileDialog saveFileDialog2 = new SaveFileDialog();

public static System.Windows.Forms.DataGridView _gridView
{
get { return gridView; }
set { gridView = value; }
}
public static System.Windows.Forms.ProgressBar _toolStripProgressBar1