Invoking the Connection Properties Dialog Box

G

Guest

I try to invoke Connection Properties dialog box that Visual Studio 2005 use.
The dialog that I said is used in many places such as when developers build
connection string in Settings.setting file
(http://www.one.co.th/downloads/Settings.settings.png). The Connection
Properties dialog box will appear to allow developers to build connection
string. I found article
(http://support.microsoft.com/default.aspx?scid=kb;en-us;Q309485) in MSDN
that use Data Link Properties dialog box but it is not fit to my requirement.
Data Link Properties dialog box allow user to select many types of database
but I just want user to select only SQL Server and Data Link Properties
dialog box is not allow user to build connection string for SQL Server
Express Edition. I am very sure that the Connection Properties dialog box can
invoke programmatically by using .NET Framework but unfortunately I cannot
find any articles that talk about it or I may misunderstand :). If anyone
know how to invoke the Connection Properties dialog box, please tell me or
just navigate me to the article.

Thanks
Teeravee Sirinapasawasdee
 
N

Nicholas Paldino [.NET/C# MVP]

Teeravee,

Are you showing an object in the PropertyGrid which has a property which
should be the connection string? This is going to be the only way you can
do this, as that mechanism uses the component model attributes for
indicating the designer. You could attach the following attribute to that
property, like so:

Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor,
Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor,
System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")

But there is a problem with this. That editor is part of Visual Studio,
and I am almost positive that the EULA would require that VS.NET be
installed on the machine that wants to use this assembly (you would have to
include the Microsoft.VSDesigner assembly somewhere in your app as well).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top