如何部署基于Visual C#2010的应用程序,它使用sql server 2008存储和检索数据+? [英] how to deploy visual C# 2010 Based Application which use sql server 2008 to store and retrieve data+?

查看:86
本文介绍了如何部署基于Visual C#2010的应用程序,它使用sql server 2008存储和检索数据+?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在visual c#中开发了应用程序,当我将此应用程序部署到朋友PC时,使用sql server 2008存储和检索数据。

1)因为绝对链接我收到错误连接到数据库

2)我需要安装sql server并在该PC上恢复数据库

有没有办法自动化这个,比如搜索数据库并连接它以便我的第一个问题将会解决并自动安装所需的sql server组件,而不是整个安装sql server。

如果需要,可以随意询问更多具体细节。

解决方案

< blockquote>为什么不能在部署应用程序的机器中安装和设置整个SQL数据库,为什么不能将解决方案的App_Data文件夹用于Sql MDF文件存储,然后使用该MDF文件进行应用程序。

如果在部署应用程序的机器上不需要SQL服务器,虽然需要安装SQL适配器。


i developed application in visual c# which use sql server 2008 to store and retrieve data when i deploy this application to friend PC.
1)because of absolute link i am getting error to connect to the database
2)i need to install sql server and restore database on that pc
is there any way to automate this like searching database and connect it so that my first problem will solve and also automatically install required sql server component instead of whole installation of sql server.
feel free to asked more specific details if required.

解决方案

Instead of installing and setting up the entire SQL database in the machine where you are deploying the application, why cant you use the App_Data folder of your solution for the Sql MDF file storage and then use that MDF file for application.
If will not require the SQL server on the machine where you are deploying the Application, though will require the SQL adapters installed.


这篇关于如何部署基于Visual C#2010的应用程序,它使用sql server 2008存储和检索数据+?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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