控制台应用程序生成Excel文件 [英] Console application to generate Excel file

查看:81
本文介绍了控制台应用程序生成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
< a rel =nofollowhref =http://bytes.thinkersroom.comtarget =_ blank> http://bytes.thinkersroom.com


Rad,


你会不会回答VB.Net新闻组中的C#问题。


我从未见过由MVP完成,至少没有告诉我有更好的新闻组。


提前谢谢


Cor


" Rad [Visual C#MVP]" < no **** @ nospam.comschreef在bericht

新闻:11 *************** @fickersroom.com ...
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****@nospam.comschreef in bericht
news:11***************@thinkersroom.com...

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



可能是sql server帐户那个您用来运行xp_cmdshell

帐户

无权运行此类系统存储过程。您将需要

来授予该帐户相应的权利


-

Bits.Bytes
< a rel =nofollowhref =http://bytes.thinkersroom.comtarget =_ blank> http://bytes.thinkersroom.com





" 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 **** @ nospam.comschreef在bericht

新闻:11 *************** @fickersroom.com ...
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****@nospam.comschreef in bericht
news:11***************@thinkersroom.com...

> 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 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


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

-
Bits.Bytes
http://bytes.thinkersroom.com




这篇关于控制台应用程序生成Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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