将数据库记录保存到excel文件中,弹出消息 [英] saving the database records into excel file,pop up message

查看:75
本文介绍了将数据库记录保存到excel文件中,弹出消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码如下将数据库记录保存到excel中,如下所示;



xlWorkBook.SaveAs(@C:\ CourseWiseReport.xls ,Excel.XlFileFormat.xlWorkbookNormal,misValue,misValue,misValue,misValue,Excel.XlSaveAsAccessMode.xlExclusive,misValue,misValue,misValue,misValue,misValue);





当我保存excel时,在保存excel文件消息之前显示



一个名为''C:\courseWiseReprot.xls''的文件已经存在于这个loaction中。你要替换它吗?

是否取消。



当我保存excel时,当我点击按钮我想显示如下消息



Excel文件已创建。



i想显示以上内容仅限消息。

i不想要

一个名为''C:\courseWiseReprot.xls'的文件已存在于此loaction中。你要替换它吗?

是否取消。

上一条消息。



我该怎么办?



帮助我。

my code as follows saving the database records in to excel for that code as follows;

xlWorkBook.SaveAs(@"C:\CourseWiseReport.xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);


when i save the excel,before saving the excel file message shows

A file named ''C:\courseWiseReprot.xls'' already exists in this loaction.Do you want to replace it?
Yes No Cancel.

when i save the excel,when i click the button i want to show the message as follows

Excel File Created.

i want to show the above message only.
i do not want
A file named ''C:\courseWiseReprot.xls'' already exists in this loaction.Do you want to replace it?
Yes No Cancel.
the previous message.

how can i do?

help me.

推荐答案

在执行SaveAs操作之前将WorkBook.Saved属性设置为true以避免提示对话框

WorkBoo.Saved [ ^ ]
set the WorkBook.Saved property to true before you perform the SaveAs operation to avoid the prompt dialog box
WorkBoo.Saved[^]


请参阅此示例 [ ^ ]和解决方案#1也适合您的查询......
See this example[^] and Solution #1 is also right for your query...


这篇关于将数据库记录保存到excel文件中,弹出消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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