Invoking ADO.NET Connection String dialog?

B

Ben Fidge

How do you invoke the connection string builder (Data
Link Properties) dialog box programmatically?

I need to be able to allow users to manually build
ADO.NET connection strings using the same dialog as the
IDE does when you select "New Connection..." in the
ConnectionString drop-down in SqlConnection Properties
window.

Thanks

Ben Fidge
 
P

Pablo Castro [MS]

The data link dialog is an OLEDB feature. ADO.NET does not have a similar
thing. If you only use the OleDb managed provider in ado.net, you can still
have the dialog pop-up by using the same oledb services that are available
for native code (a simple way is to add "prompt=prompt" in the connection
string). Note that this won't work for the other providers.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Ben Fidge

Pablo,

Thanks for your reponse. I've managed to use the DataLinksClass.PromptEdit
to retrieve an OLEDB Connection string. I've been advised elsewhere on this
newsgroup to check for Sql Server in the return Connection String, and then
simply drop the provider section. All seems ok.

I'm just curious what adding "prompt=prompt" to the connection string before
calling DataLinksClass.PromptEdit actually does?

Thanks

Ben
 
P

Pablo Castro [MS]

It just passes that PROMPT option down in the stack so oledb will show the
typical database login dialog. Note that it's not an ADO.NET thing, but an
OLEDB thing.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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