在Windows窗体安装项目中包括数据库 [英] Include database in windows forms setup project

查看:123
本文介绍了在Windows窗体安装项目中包括数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows应用程序,并在sql server 2005中为该应用程序创建了数据库.然后我从服务器资源管理器中添加了到数据库的连接(右键单击数据连接->添加新的连接)当我通过创建新的安装模板或单击publish创建安装文件时,.msi或.exe文件在其他计算机上将无法使用,因为该数据库未包含在项目中.
如何将数据包含在可执行文件中(不是sql server仅表示数据库)

I created a windows application and i created database for that application in sql server 2005.then i add connection to the database from server explorer(right click on Data connections-->add new connection)every thing works fine in my system.when i create the setup file by creating the new setup template or by clicking on publish.the files .msi or .exe wont work on other computers because the database is not included in the project.
how to include the databe in the executable file(not sql server express simply database only)

推荐答案



您可以在Visual Studio安装程序项目中使用自定义操作将数据库安装在目标计算机上.

一个很好的开始就是阅读这篇很好的文章,它将向您解释如何做.

使用安装程序类轻松部署SQL Server数据库 [
Hi,

You could use custom actions in your visual studio installer project to install your database on the target computer.

A good start would be to read this very good article that will explain you how to do it.

Deploy SQL Server databases easily with an Installer class[^]

You can also consult msdn for detailed information.

Valery.


希望
Hope this[^]will give you an idea.


此外,请查看以下讨论链接:
链接1 [ ^ ]
链接2 [ ^ ]
链接3 [
Also, have a look at these discussion links:
Link 1[^]
Link 2[^]
Link 3[^]


这篇关于在Windows窗体安装项目中包括数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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