Re: PromptDataSource method
- From: "Polaris431" <polaris431@xxxxxxxxx>
- Date: 7 Nov 2006 22:54:00 -0800
Add a reference to Microsoft.Data.ConnectionUI. This is located in the
directory where VS is installed, eg:
C:\Program Files\VS8\Common7\IDE\Microsoft.Data.ConnectionUI.dll
Add the following code...
using Microsoft.Data.ConnectionUI;
....
Microsoft.Data.ConnectionUI.DataConnectionDialog dcd = new
Microsoft.Data.ConnectionUI.DataConnectionDialog();
Microsoft.Data.ConnectionUI.DataSource.AddStandardDataSources(dcd);
if (Microsoft.Data.ConnectionUI.DataConnectionDialog.Show(dcd)
== System.Windows.Forms.DialogResult.OK)
{
string buf = "Provider: " + dcd.SelectedDataProvider.Name +
"\r\n" + "ConnectionString: " + dcd.ConnectionString;
}
This is an undocumented method of displaying the same dialog that
VS.NET uses. But what the hack (I mean what the 'heck'). Some features
eventually find their way into a product when enough users use the hack
and Microsoft eventually catches on. This feature really should have
been in the product from day one. You listening MS?
Best Regards
Polaris431
.
- Prev by Date: Re: Type alias in C#
- Next by Date: Re: override method without extending visibility
- Previous by thread: RE: A problem of invoking C# DLL from VBA
- Next by thread: Problem with AccessViolationException
- Index(es):
Relevant Pages
|