Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Get List of Servers with list of databases

Hello Team,

After connecting to server, i have a requirement to get list of databases into LISTBOX or COMBOBOX on the same page.

According to the guidelines provided by advanced installer, getting list of servers are in one dialog & list of databases are shown in another dialog. But i want to show them in the single dialog.

Regards
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Get List of Servers with list of databases

Hello,

This can be done. There is no limitation that you should have on separate dialogs the Browse Servers operation and the Browse Databases operation.

The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Attachments
Test SQL Connection Sample.zip
(5.23 KiB) Downloaded 547 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Get List of Servers with list of databases

Thanks a lot for your help.

It is working as expected. I have another requirement added to this is to run a script with two conditions in both Windows Authentication & SQL Server Login.

1. If the database doesnot exists in the combobox, user can enter the name of the database on the combobox. Our current version is allowing to enter database name and not allowing to create database.
2. If the database exists in the combobox and user selects the database and the script should run accordingly by taking the selected database.

Please find attached sample.

Errors: Datasource name not found and no default driver specified.Please find attached ScreenShot.


Note:Script contains the logic of creating database if not exists.If the database exists it will update with other logic.

Kindly do the needful.

Regards
Attachments
AdvancedInstaller.png
AdvancedInstaller.png (14.92 KiB) Viewed 9592 times
Test SQL Connection Sample with db creation.zip
(5.81 KiB) Downloaded 461 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Get List of Servers with list of databases

Hello,

I've attached a new sample project to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file. The first sample was not ready to support script execution. It was just a sample project in order to see how you can add database and server browse operation on the same dialog.

Basically, the user is allowed to select an existing database or to create a new one. In the sample script code, if the database does not not exist, it will be created.

If you have any questions, please let me know.

Best regards,
Dan
Attachments
Test SQL Connection Sample and Create New Database.zip
(5.87 KiB) Downloaded 514 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Get List of Servers with list of databases

Thankyou very much for your quick help.

I have tried to update the connection string in web.config file in the following way,

On Select the [ Next ] button from this dialog and go to the Published Events tab and add a new "Set installer property value" Published Event with the following parameters, based on the SQL Server:

Name: [ConnectionString] (Which was created as new parameter)
Argument: Server=[SERVER_PROP];User Id=[USERNAME_PROP];Password=[PASSWORD_PROP];
Condition: 1 (it will be shown as AI_INSTALL)

And the same i have called under web.config file parameter ConnectionString. But after running the installer, the connection string in web.config file is updating with value="your value".
Let me know the approach to move forward.


Regards,
Bindu
Attachments
Test SQL Connection Sample and Create New Database.zip
(15.94 KiB) Downloaded 641 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Get List of Servers with list of databases

You're welcome Bindu,

This is happening because the ConnectionString property is a private property. Here, you can read more way you get the default value of a property.

To overcome this, you need to use an intermediary public property that will be saved in the webconfig file. Set the new public property with the value of the ConnectionString property. For this operation, you can use the predefined Set installer property custom action.

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Get List of Servers with list of databases

Hi Team,

I have a problem with web.config file connection string update with encrypted password using custom action.
Please find the attached sample project for your reference.

When i am trying to update the connection string with the encrypted password in web.config file it is passing empty string to the property.

In the below attached project i am passing 'PASSWORD_PROP_1' as a input parameter and it will send the return value using 'RET_VAL_FROM_ENCRYPT' property to the advanced installer

Please do the needful.

Thanks in advance
Attachments
Sample.zip
(142.26 KiB) Downloaded 511 times
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Get List of Servers with list of databases

Any help on the above???


Regards
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Get List of Servers with list of databases

Hi,

I'm afraid our support services does not include debugging your custom action.

If you have other questions regarding Advanced Installer, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”