动态连接字符串配置
问题描述:
我希望我的C#winforms项目连接字符串在客户端设置期间(在设置向导中)可配置,以便客户端可以将服务器设置配置为根据他们的数据库服务器名称和密码。
但我一直在考虑如何做到这一点。需要帮助的接力。
使用vs2010和sql server 2008 r2作为数据库。
任何愿意提供帮助的机构都将受到高度赞赏。
Hi,
I want my C# winforms projects connection string configurable during a setup by the client ( within a setup wizard) so that client can configure server setting as per their db-server name and password.
But am stuck thinking how to do that. Relay in need of a help.
am using vs2010 and sql server 2008 r2 as database.
Any body there willing to help will be highly appreciated.
答
您可以使用安装项目执行此操作。您必须自己编写表单,但这很简单。您甚至可以模拟在其他安装程序上找到的检测服务器功能:
按照此设置安装项目
https://msdn.microsoft.com/en-us/library/vstudio /19x10e5c(v=vs.100).aspx [ ^ ]
You can do this with a setup project. You will have to code the form yourself, but that's pretty easy. You can even emulate the "detect server" functionality you find on other installers:
Follow this to set up an install project
https://msdn.microsoft.com/en-us/library/vstudio/19x10e5c(v=vs.100).aspx[^]