如何将数据从SQL Server(使用查询)导出到Excel文件 [英] How to export data from SQL server (using query) to Excel file

查看:84
本文介绍了如何将数据从SQL Server(使用查询)导出到Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VB.net编程的新手,并开始使用Visual Studio Community 2015.

I am new to programming on VB.net and start using Visual Studio Community 2015.

我需要做的是单击按钮(我有一个表单),然后在SQL中进行选择(我写了查询),然后将其粘贴到Excel电子表格中.我已经在网上搜索了一些示例,发现了以下内容,但对我来说却无法正常工作,错误发生在:  Microsoft.Office.Interop.Excel.Worksheet/Application

What I need to do is on single button click (I have a form) make a selection in SQL (I have written query) to be pasted on Excel spreadsheet. I have searched for examples on web, found the below, but it does not properly work for me, eror occurs on: Microsoft.Office.Interop.Excel.Worksheet/Application

我已将Microsoft Excel 16.0对象库添加到我的项目中

推荐答案

发生什么错误,并在哪一行代码上发生?
What is the error and on which line of code does it occur?


这篇关于如何将数据从SQL Server(使用查询)导出到Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆