我可以使用一些 Gui 组件来允许用户创建连接字符串吗?
我有一个客户端应用程序,它将使用连接字符串来访问某些数据。 我需要管理员能够定义客户端将使用的连接字符串。 我想为他们提供一个类似于用于定义新 ODBC 数据源的向导,但不想自己编写所有这些功能。 有什么方法可以启动此向导,或者是否可以使用一些组件来允许管理员定义要分发给客户端的连接字符串?
I have an client app which will use a connection string to get access to some data. I need the administrators to be able to define the connection string that the clients will use. I would like to give them a wizard similar to the one that is used to define a new ODBC data source, but don't want to write all of this functionality myself. Is there some way that I can kick off this wizard, or is there some components that I can use to allow the administrator to define the connection string to hand out to clients?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果这对其他人有用,我最终要做的是:
创建所选类型的 DbProviderFactory(所选类型来自 DbProviderFactories.GetFactoryClasses ()),
然后使用它创建 DbConnectionStringBuilder。 然后可以将此连接字符串生成器绑定到属性网格,然后属性网格将根据给定的 DbConnectionStringBuilder 的特定类型公开不同的属性。
它并不完全是我正在寻找的向导,但它给了我一个快速的 GUI 供用户使用。
In case this is useful to anyone else, what I ended up doing is this:
Create a DbProviderFactory of the selected type (the selected types coming from DbProviderFactories.GetFactoryClasses ())
then use this to create a DbConnectionStringBuilder. This connection string builder can then be bound to a property grid, which will then expose different properties depending on the specific type of the DbConnectionStringBuilder it is given.
Its not exactly the wizard I was looking for, but it gave me a quick gui for the user to use.
看看这个 http://geekswithblogs.net/thibbard/archive/2005/06/29/45087.aspx也在讨论中我可以为你实现它)))
Look at this one http://geekswithblogs.net/thibbard/archive/2005/06/29/45087.aspx also in discuss I could implement it for you)))