将sql server数据库与服务器分离后,能否将sql server数据库连接到客户端的服务器上? [英] Can I connect sql server database to server on client side when i detach it from my server?

查看:118
本文介绍了将sql server数据库与服务器分离后,能否将sql server数据库连接到客户端的服务器上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS 2008&我的应用程序是基于报告的.
如果我将sqldatabase从服务器上分离后放到我的项目中的DB文件夹中,我想为此设置项目.所以现在我想在客户端machin上部署此项目时使用此数据库.我该怎么写connnectionstring有没有什么解决办法,有没有需要把数据库的备份文件.
请帮帮我.
我不知道如何更改ConnectionString,以使其在安装后自动连接.

I am using VS 2008 & my application is report based.
I want to make setup of my project for that if i put my sqldatabase to DB folder in my project after detach it from server. So now i want to use this database when i deploye this project on client machin. How can i write connnectionstring is there any solution is there any need to put backup file of database.
please help me.
I don''t know how to change ConnectionString so that it will automatically connected after install.

推荐答案

不幸的是,您需要一些技巧来做到这一点...如果您想自动化此过程,请具有SQL和C#编程技能.

否则,您需要使用包含一些OSQL命令的批处理文件.为此,您也将需要OSQL.exe.使用Project Installer设置项目无法做到这一点.
Unfortunately you need some skill to do this... You need to have SQL & C# programming skills if you want to automate this process.

Otherwise you need to use a batch file containing some OSQL commands. For this you will require OSQL.exe too. There is no easy way to do this with a Project Installer setup project.


这篇关于将sql server数据库与服务器分离后,能否将sql server数据库连接到客户端的服务器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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