(相关资料图)
[ private void SaveTo(System.Data.DataTable table, string fileName) { int columnIndex = 1; int rowIndex = 1; Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); excelApp.DefaultFilePath = fileName; excelApp.DisplayAlerts = true; excelApp.SheetsInNewWorkbook = 1; Microsoft.Office.Interop.Excel.Workbook workbook = excelApp.Workbooks.Add(true); foreach (System.Data.DataColumn column in table.Columns) { excelApp.Cells[rowIndex, columnIndex] = column.ColumnName; columnIndex++; } for (int i = 0; i < table.Rows.Count; i++) { columnIndex = 1; rowIndex++; for (int j = 0; j < table.Columns.Count; j++) { excelApp.Cells[rowIndex, columnIndex] = table.Rows[i][j].ToString(); columnIndex++; } } workbook.SaveCopyAs(fileName); excelApp = null; workbook = null; }
推荐内容
-
CAD二次开发 学习笔记(3)
-
中原地产:香港二手楼价指数连跌三周后回升-独家
-
日本最大银行三菱日联金融(MUFG.US)考虑发行全球稳定币_今日热议
-
端午档票房突破5亿元 《消失的她》成为票房冠军 世界速看
-
加息影响显现 欧元区6月综合PMI初值创5个月新低_焦点速递
-
环球讯息:巴金:支持美联储进一步加息 避免通胀卷土重来
-
张家界首现国家一级保护野生动物海南鳽 天天热推荐
-
火灾隐患曝光_每日热文
-
这届韩国年轻人,想靠彩票改命|天天微资讯
-
世界快资讯丨好评中国丨端午赛龙舟,凝聚民心的文化符号
-
我国累计招收博士后约34万人-环球微资讯
-
世界今头条!lenovo联想笔记本电脑ThinkBook 15 G2-ITL(20VE)原装Win10系统恢复原厂出厂设置系统
-
土耳其央行加息不及预期 里拉跌至历史新低 天天热门
-
珠海已受理近万宗港澳驾驶人免试换领内地驾驶证_焦点热闻
-
当前速看:百融云AI大模型的“向量”战争
-
殊荣(关于殊荣介绍) 每日快播
-
ccl底背离选股公式(cci底背离选股公式) 环球信息
-
【天天报资讯】去中心化之旅的“大都市”以太坊;zkSync成为以太坊Layer2新龙头| 区块客周刊
-
天天速读:端午假日第一天:上海市共接待游客276.38万人次
-
天天看点:各大央行近期鹰声不断 但长期美债获多头青睐
-
GGII:预计2025年中国锂电池X-Ray/CT检测设备市场规模达28亿元 全球焦点
-
阿里云“能耗宝”助奥林匹克电竞周分析碳足迹_要闻
-
端午档票房突破5亿|看点
-
天天观察:电力智能运维,筑起亚运安全“防护墙”
-
启东二手房出售信息网_启东二手房网
-
有机化学 第二版_对于有机化学 第二版简单介绍
-
香港特区政府政务司司长陈国基:香港“抢人才”也要“留人才”-当前速读
-
港元拆息全线下跌 隔夜息连跌三天 全球快资讯
-
日经225指数全日跌幅1.45% 报32781.54点 热资讯
-
天天热点!陕西高考成绩即将公布!最新政策发布
-
里昂:下调维他奶国际评级至“跑输大市” 目标价降至13.3港元
-
世界即时:耳朵进水后像堵了一层膜听不清(耳朵进水)
-
【全球新要闻】戚继光抗倭简介10个字_戚继光抗倭简介
-
遇到燃气泄漏应该如何处理?这份安全提示请查收
-
天天新消息丨腾翼c30_腾翼c302012款
-
天天看热讯:安徽青阳:“青山之阳•九华原乡旅游季”之2023陵阳端午溯“原”活动完美落幕
-
诗书画端午 | “桨声灯影”里的龙舟竞渡 环球快报
-
当前最新:停息挂账哪个银行好申请?怎么和银行谈停息挂账?-环球热议
-
上汽通用召回78205辆旗下车辆 涉及别克昂科雷、雪佛兰探界者
-
因存机油泄露风险 捷豹路虎召回12辆进口揽胜、揽胜运动、卫士系列汽车
-
快消息!转向柱存在安全隐患 19辆进口大切诺基4xe被召回
-
环球即时看!多地端午假期首日旅游成绩单出炉,你贡献了多少?
-
世界观热点:微软预计:下一代Xbox和索尼PS6将于2028年发售
-
高温持续超40℃!聊城继续发布红色预警! 环球速讯
-
当前热门:内江第十一届大千龙舟文化节市中区端午民俗活动举行
-
日本5月核心CPI高于预期 日本央行“转向”近在咫尺?
-
航班管家:端午节首日全民航执行客运航班量14460架次 同比增长229.4%
-
要闻:6月香港强积金平均投资回报约4.26% 人均赚6600港元
-
2023年端午档档期票房破4亿
-
做手术可以吗?这样真的很难看
-
环球微动态丨1.5匹空调是多少瓦(匹空调是多少瓦)
-
赤坎调顺街道开展征兵政策宣讲|世界关注
-
网络中国节·端午丨挥桨破浪!贵州碧江龙舟破浪竞风流
-
【港股通】小鹏(09868)计划明年在港推出一款右軚车型 世界速讯
-
广西壮族自治区兴安县发布雷电黄色预警_世界滚动
-
宋文仲
-
【全球新要闻】92亿美元!福特获得金融危机以来美国政府向车企提供的最大规模贷款
-
国际奥委会全会撤销对国际拳联的承认
-
国际奥委会全会撤销对国际拳联的承认|热议
-
大和:将中国电力股板块评级由“负面”上调至“正面”
-
世界头条:集邦咨询:硅料价格降幅收窄 硅片价格率先止跌
-
文旅部:各地要指导A级旅游景区对洪灾风险区、地质灾害易发区等关键部位开展全面细致摸排-焦点快播
-
视点!OpenAI创始人:人工智能会带来一些问题 呼吁人工智能全球监管
-
OpenAI CEO:AI是人类技术迄今最重要一步 监管应适度|天天快看点
-
天天视点!美国谘商会领先指标连续14个月下降 凸显未来经济疲软
-
江苏省头部城市的集体崛起:南京、苏州、无锡 全球时讯
-
北京车号摇下来多长时间必须买车_车号摇下来了 不想买车怎么办
-
形成算力资源优势 带动人工智能聚集 AI算力高峰论坛在甘肃召开|全球快报
-
新闻1+1丨我国新能源汽车,何以快速发展?
-
妥了!罗马诺:纽卡签托纳利与米兰完全达成协议 转会费7000万欧
-
快看点丨湘乡市举办“端午飘香‘粽’是情”文艺汇演
-
世界乒乓球职业大联盟WTT澳门冠军赛落幕 快播报
-
环球热门:江西省鹰潭市2023-06-17 15:06发布雷电黄色预警
-
迪马:戈森斯愿加盟柏林联,国米要价1500万欧
-
每日热点:泽连斯基解除乌克兰驻白俄罗斯大使职务
-
科技界MMA?马斯克和扎克伯格相约拉斯维加斯“决斗”
-
即时:京东方A:4K Micro OLED近眼显示样机性能业内领先
-
18岁“土超梅西”引5大豪门争抢,皇马出手,纽卡2000万英镑报价
-
Woj:湖人将47号签和部分现金交易至步行者 换来40号签
-
定鼎门在什么位置(定鼎门)
-
非法狩猎关于具体的立案标准怎么认定
-
罗马诺:曼联希望下周敲定芒特,6000万-6500万镑足以放人
-
发胖有哪些原因(发胖的原因有哪些)
-
天天热点!盗墓笔记贺岁篇完整版_盗墓笔记贺岁篇
-
摩尔庄园魔法衣柜在_摩尔庄园魔法衣柜|环球热议
-
热头条丨吉他滴答滴答吉他谱_滴答吉他谱
-
范星光_关于范星光的简介
-
月光如水水如天_关于月光如水水如天的介绍 快看点
-
牡丹花种子种植方法(牡丹花种子怎么种)|全球热资讯
-
世界快资讯:离开一年后,再追大结局,彻底被燃到了
-
ipad百度网盘下载的文件在哪里-全球微资讯
-
当前头条:认知理论模型(认知理论)
-
行路难行路难_关于行路难行路难的介绍 信息
-
东京与暴雨与女孩_环球讯息
-
小摩:若美联储不降息 美股将在今年下半年陷入困境|当前热闻
-
挪威出台政策扶持关键矿产开发 电池材料公司Kuniko闻风上涨 7年预算近60亿 必和必拓加紧能源转型步伐
-
泰裤辣!一起来拆太空“盲盒”
-
【新闻】小米48亿元资金或被印度没收 世界今头条
-
世界快资讯:美国初请失业金人数意外小幅上升 连续三周高于26万
-
苹果(AAPL.US)助推Meta(Meta.US)元宇宙“落地”? 今日精选