将类型化数据集的连接字符串用于客户端应用程序 [英] Using typed datasets' connection string for client application

查看:60
本文介绍了将类型化数据集的连接字符串用于客户端应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已将数据集(类型)的连接字符串设置为

Data Source=MyHomeServer\SQLEXPRESS;Initial Catalog=dbTestSharing;Integrated Security=True
这将是一个客户端应用程序.我需要在连接字符串中更改机器名称,以便它可以与服务器连接.
我不知道如何更改.

感谢

解决方案

将连接字符串放在应用程序的.config文件中,然后从那里检索它.
可以在每次安装中编辑该文件,这样您就不需要每次安装都重新编译.

请查看这些链接,以帮助您了解如何使用这些配置文件.
存储和检索连接字符串 [ 解决方案

Place your connection string in the .config file for your application and retrieve it from there.
That file can be edited in each installation so that you do not require a recompile for each install.

Check out these links to help in understanding how to use these configuration files.
Storing and Retrieving Connection Strings[^]

When deploying the application on a client machine, the .config file that is deployed with the application is a plain text file that can be opened in Notepad and simply updated with the appropriate connection string required.


这篇关于将类型化数据集的连接字符串用于客户端应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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