控制台应用程序生成Excel文件

编程入门 行业动态 更新时间:2024-10-18 06:07:50
本文介绍了控制台应用程序生成Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好 我创建了一个C#控制台应用程序,使用xp_cmdshell通过 存储过程调用。该应用程序从数据库生成一个Excel 报告,其中嵌入了一个宏。通过xp_cmdshell报告 生成失败。 但是当我尝试从命令提示符运行可执行文件时生成 报告成功使用宏。什么可能是这里的 问题? 提前谢谢 Senthil

Hi all I created a C# console application that is called through a stored procedure using xp_cmdshell. The application generates an Excel report from the database with a macro embedded in it. The report generation fails when it is through xp_cmdshell. But when I tried to run the executable from the command prompt the report gets generated successfully with the macro. What could be the problem here?? Thanks in advance Senthil

推荐答案

2007年1月15日05:33:02 -0800,Senthil写道: On 15 Jan 2007 05:33:02 -0800, Senthil wrote: 大家好/> 我创建了一个C#控制台应用程序,它使用xp_cmdshell通过 存储过程调用。该应用程序从数据库生成一个Excel 报告,其中嵌入了一个宏。通过xp_cmdshell报告 生成失败。 但是当我尝试从命令提示符运行可执行文件时生成 报告成功使用宏。什么可能是这里的 问题? 提前致谢 Senthil Hi all I created a C# console application that is called through a stored procedure using xp_cmdshell. The application generates an Excel report from the database with a macro embedded in it. The report generation fails when it is through xp_cmdshell. But when I tried to run the executable from the command prompt the report gets generated successfully with the macro. What could be the problem here?? Thanks in advance Senthil

可能用于运行xp_cmdshell帐户的sql server帐户 无权运行此类系统存储过程。您将需要 来授予该帐户相应的权利 - Bits.Bytes bytes.thinkersroom

Rad, 你会不会回答VB.Net新闻组中的C#问题。 我从未见过由MVP完成,至少没有告诉我有更好的新闻组。 提前谢谢 Cor " Rad [Visual C#MVP]" < no **** @ nospamschreef在bericht 新闻:11 *************** @fickersroom ... Rad, Will you be so kind not to answer C# questions in the VB.Net newsgroup. I never saw that done by a MVP without telling at least that there was a better newsgroup for that. Thanks in advance Cor "Rad [Visual C# MVP]" <no****@nospamschreef in bericht news:11***************@thinkersroom... 2007年1月15日05:33:02 -0800,Senthil写道: On 15 Jan 2007 05:33:02 -0800, Senthil wrote: >大家好我创建了一个C#控制台应用程序,使用xp_cmdshell通过存储过程调用。应用程序从数据库中生成一个Excel 报告,其中嵌入了一个宏。通过xp_cmdshell报告生成失败。但是当我尝试从命令提示符运行可执行文件时,使用宏成功生成了报告。这可能是什么问题? 提前致谢 Senthil >Hi all I created a C# console application that is called through astored procedure using xp_cmdshell. The application generates an Excelreport from the database with a macro embedded in it. The reportgeneration fails when it is through xp_cmdshell.But when I tried to run the executable from the command prompt thereport gets generated successfully with the macro. What could be theproblem here??Thanks in advanceSenthil

可能是sql server帐户那个您用来运行xp_cmdshell 帐户 无权运行此类系统存储过程。您将需要 来授予该帐户相应的权利 - Bits.Bytes bytes.thinkersroom

" Cor Ligthert [MVP]" < no ************ @ planet.nlwrote in message news:eY ************** @ TK2MSFTNGP04.phx .gbl ... "Cor Ligthert [MVP]" <no************@planet.nlwrote in message news:eY**************@TK2MSFTNGP04.phx.gbl... Rad, 你会不会回答VB.Net中的C#问题 新闻组。 我从来没有看到MVP完成的事情,至少没有告诉那个有更好的新闻组。 提前致谢 Cor " Rad [Visual C#MVP]" < no **** @ nospamschreef在bericht 新闻:11 *************** @fickersroom ... Rad, Will you be so kind not to answer C# questions in the VB.Net newsgroup. I never saw that done by a MVP without telling at least that there was a better newsgroup for that. Thanks in advance Cor "Rad [Visual C# MVP]" <no****@nospamschreef in bericht news:11***************@thinkersroom... > 2007年1月15日05:33:02 -0800,Senthil写道: >On 15 Jan 2007 05:33:02 -0800, Senthil wrote: >> Hi所有我创建了一个C#控制台应用程序,使用xp_cmdshell通过存储过程调用。该应用程序从数据库中生成一个包含宏的宏报告。通过xp_cmdshell报告生成失败。但是当我尝试从命令提示符运行可执行文件时,使用宏成功生成了报告。这可能是什么问题? 提前致谢 Senthil >>Hi all I created a C# console application that is called through astored procedure using xp_cmdshell. The application generates anExcelreport from the database with a macro embedded in it. The reportgeneration fails when it is through xp_cmdshell.But when I tried to run the executable from the command prompt thereport gets generated successfully with the macro. What could be theproblem here??Thanks in advanceSenthil

可能是您用来运行的sql server帐户xp_cmdshell 帐户无权运行此类系统存储过程。您将需要授予帐户相应的权利 - Bits.Bytes bytes.thinkersroom

更多推荐

控制台应用程序生成Excel文件

本文发布于:2023-11-13 15:08:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584663.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   文件   Excel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!