Is there a way to display the connection properties dialog for connection string browsing(for database) in run time?
As I want the user to be able to connect to various database using the GUI. The same one as we get in visual studio connection properties dialog.
Thanks in Advance
To edit a connection string stored in application settingsLocate the connection you want to edit and select the text in the Value field. Edit the connection string in the Value field, or click the ellipsis (...) button in the Value field to edit your connection with the Connection Properties dialog box.
After opening the web. config file in application, add sample db connection in connectionStrings section like this: <connectionStrings>
Connection strings in configuration files are typically stored inside the <connectionStrings> element in the app. config for a Windows application, or the web. config file for an ASP.NET application.
Look for this article explaining exactly what are you looking for. What she say is the following:
You will need to add a couple references to your project:
Use the following code:
using MSDASC;
using ADODB;
private string BuildConnectionString()
{
string strConnString = "";
object _con = null;
MSDASC.DataLinks _link = new MSDASC.DataLinks();
_con = _link.PromptNew();
if (_con == null) return string.Empty;
strConnString = ((ADODB.Connection)_con).ConnectionString;
return strConnString;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With