安装项目中的数据库事务 [英] Database transactions in setup project
问题描述
大家好,
我在Windows应用程序上工作.我为此创建了一个设置.该应用程序具有一些数据库事务.连接字符串我放置在App.config中.我在安装程序中将App.Config和Primaryoutput添加到了应用程序文件夹中.安装此程序后,我没有看到任何事务在数据库上运行.
有什么办法可以使这项工作成功吗?
请在这方面帮助我.
在此先感谢.
Hello All,
I worked on a windows application. I created a setup for this. This application has some database transactions. Connection String i placed in App.config. I added App.Config and Primaryoutput to the application folder in setup. After installing this,I didn''t see any transaction working on database.
Is there any way to make this work?
Please help me in this regard.
Thanks in Advance.
推荐答案
在您的App.config中,连接字符串应如下所示,
In your App.config connection string should be like this,
<add name="SampleProject.Properties.Settings.ConnectionStrin"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SampleProjectDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
您的数据库可以放在您的exe目录中.
最好的问候,
Theingi Win
Your database can placed in your exe directory.
Best Regard,
Theingi Win
这篇关于安装项目中的数据库事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!