使用C#将sql数据库添加到发布文件夹 [英] adding sql database to a publish folder with C#

查看:121
本文介绍了使用C#将sql数据库添加到发布文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用sql数据库的软件.我正在尝试使用Visual Studio 2008的发布实用程序创建安装程序,以便可以在其他计算机上安装该软件.我的问题是,每当我使用发布来创建安装程序时,它都不会添加该软件需要正常运行的sql数据库.请任何人给我提示如何使其正确运行.
Thankz

hi guys, i''m working on a software that uses an sql database. I''m trying to create an installer with the publish utility of visual studio 2008 so that i can install the software on other computers. My problem is that whenever i use the publish to create the installer, it doesn''t add the sql database that the software needs to run properly. please can anyone give me a hint on how to make it work right.
thankz

推荐答案

你好朋友..

如果可以使用安装项目,则可以将数据库文件添加到应用程序文件夹中,以将该文件复制到安装目录中.
application.startuppath是获取应用程序或项目.exe文件运行路径的方法.
然后对于连接字符串,您可以使用application.startuppath来获取数据库的自定义路径

使用此功能,您可以将数据库添加到安装文件中.
或请指定为项目部署的类型,例如
发布吗? ClickOnce?建立专案?其他?如Kschuler所说..
Hello Friend..

If you can Use a Setup Project, then you can add a your database file to your application folder to copy that file at your installation directory..

application.startuppath is method to get the path from where your application or project .exe file will run
then for connection string you can use a application.startuppath to get the custom path of your database

using this you can add the database to your setup file..

or please specify the type which you deploy for your project like
publishing it? ClickOnce? Setup Project? Other? as Kschuler says..


大家好,
我正在使用Visual Studio 2008在内置的发布工具中发布该项目.
我不知道是否还有其他方法可以为使用C#设计的程序创建安装程序.如果有请让我知道.
Tejas_Vaishnav,我不知道如何使用安装项目.如果您可以通过简单的要点使我了解如何使用它,则id会很感激.
谢谢
hi guys,
i''m publishing the project with Visual studio 2008 in built publishing tool.
I don''t know if there is any other means of creating an installer for programs designed in C#. if there is please let me know.
Tejas_Vaishnav, i don''t know how to use setup project. id appreciate it if you can put me through on how to use it with easy key points.
thanks


如果您使用publish方法,则无法添加其他文件,因为当您要使用现有项目发布安装程序时,这是默认的发布机制.请找到用于手动创建安装项目的链接,该链接可让您将其他sql db文件添加到安装中.

http://vijirajkumar.blogspot.com/2010/03/create-setup- and-deployment-project.html [ ^ ]
There is no option for adding an additional file if you use publish method as it''s a default mechanism for publishing when you want to release a setup with the existing project. Please find the link to create a setup project manually which would let you add the additional sql db file to your setup.

http://vijirajkumar.blogspot.com/2010/03/create-setup-and-deployment-project.html[^]


这篇关于使用C#将sql数据库添加到发布文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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