通过设置写入数据库 [英] Writing in database by setup

查看:68
本文介绍了通过设置写入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


安装程序运行时是否有可能在我的数据库中写一些东西.
我想输入安装程序运行的日期和时间.

谢谢

Hi,
Is there any possibility to write something in my database when setup runs.
I want to put the date and time at which setup runs.

Thanks

推荐答案

是的-您所要做的就是照常连接,然后在表中插入新行.

为什么这会给您带来问题?
Yes - all you have to do is connect as usual, and insert a new row to your table.

Why is this giving you problems?


您可以用几种方法来实现,一种方法是创建.sql文件并编写要在安装时执行的所有sql语句.一旦用sql语句完成文件.制作一个小程序,将.sql文件作为参数.并将在所需的数据库上执行. .sql文件编写完成后,在安装时调用该应用程序.
以下文章将帮助您在安装时调用外部应用程序.在您的情况下,外部应用程序将是将在数据库上的.sql内部执行sql语句的那个​​应用程序.
扩展Visual Studio安装项目 [
You can do it in several ways, One way is to create .sql file and write all the sql statement which you want to execute at setup time. once you completed with sql statement into file. Make one small application that will take .sql file as parameter. and will execute on required database. Call that application while setup when you done with your .sql file writting.
Following article will help you to call exeternal application while setup. In your case external application will be the that application which will execute sql statement inside .sql on database.
Extending Visual Studio Setup Project[^]


这篇关于通过设置写入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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