我想通过文本框将dbname和db服务器名称存储到app.config文件中 [英] i want to store dbname and db server name into app.config file through text box

查看:82
本文介绍了我想通过文本框将dbname和db服务器名称存储到app.config文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文本框,我在其中输入了DBNAME和DB Server名称.
我保存在app.config文件中

我怎么

想要编码

i have two text box i enter DBNAME and DB Server name in it
i save in app.config file

how can i

want to code

推荐答案

保存app.config文件(取决于您的配置和OS)需要管理权限.确定要这样做吗?
如果希望用户能够选择这些参数,则在打开数据库连接之前,仅询问用户(例如,通过表单)这两个参数,然后以编程方式构建连接字符串就容易得多.
Saving in the app.config file will (depending on your configuration and OS) require administrative rights. Are you certain that you want do this?
If you want the user to be able to select these parameters, it is much simpler to just ask the user (through a form, for example) for both parameters, and then to build your connection string programmatically, before you open the database connection.


这篇关于我想通过文本框将dbname和db服务器名称存储到app.config文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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