如何在使用sql database创建设置后更改连接字符串 [英] how to change connection string after creating set up with sql database

查看:115
本文介绍了如何在使用sql database创建设置后更改连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hiii .........





i我在我的窗口应用程序中使用Sql数据库。用于建立连接字符串我正在使用app.config。现在在创建设置后如何更改连接字符串以使用自己的Sql密码在其他系统中对项目进行操作。

Hiii.........


i am using Sql database in my window application.for making connection string i am using app.config. now after creating setup how can i change the connection string for instoling the project in other system with his own Sql password.

推荐答案

如果它是您需要的参数安装后的用户,你肯定应该在安装过程中要求它[按照Anurag的建议]。



如果您使用的是默认服务器,那么它可以像你在app.config中提供的。但是应该有一个选项可以在应用程序内部进行更改,在这种情况下,您可以使用编辑的值配置app.config文件。



祝你好运,

Edo
If it is a parameter you require from the user upon installation then you definitely should ask for it during the installation process [as suggested by Anurag].

If you are using a default server then it can work just like you provided, in the app.config. But then there should be an option to change that inside you application, in which case you can configure the app.config file with the edited values.

Good luck,
Edo


您应该允许您的安装程序执行此操作。

安装期间添加连接字符串 [ ^ ]应该给你一个公平的想法怎么做。
You should allow your setup program to do this.
Adding connection string during installation[^] should give you a fair idea on what to do.


这篇关于如何在使用sql database创建设置后更改连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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