RGB
Posts: 2
Joined: Tue Dec 03, 2013 7:38 pm

Update SQLServer Connection String Every time User Install

Hi all

Now i made a C# windows form application and i managed to make it very good :) and i used the amazing advanced installer to make setup file
the application have the ability to connect to a sql server database but only on my machine.

I get my connection string in the app using this line of code

SqlConnection Con = new SqlConnection(Properties.Settings.Default.MyDatabaseConnectionString.ToString());

how i can modify this property in app.settings from advanced installer every time a user install my app on his machine

thanks in advance :)
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update SQLServer Connection String Every time User Insta

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can import, in "Files and Folders" page, your app.settings file as an XML file. Then, you can use our XML editor support to edit accordingly the above file. Also, you can take a look on our "How do I import and edit a XML file?" article which should be useful for you.

If you have any question just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
RGB
Posts: 2
Joined: Tue Dec 03, 2013 7:38 pm

Re: Update SQLServer Connection String Every time User Insta

Daniel wrote:Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can import, in "Files and Folders" page, your app.settings file as an XML file. Then, you can use our XML editor support to edit accordingly the above file. Also, you can take a look on our "How do I import and edit a XML file?" article which should be useful for you.

If you have any question just let us know.

All the best,
Daniel

Thank you very much :)
But when i do that, do i have to modify my code to read from the new app.settings included in installation folder or that will modify direct in app.settings made by visual studio ?!
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update SQLServer Connection String Every time User Insta

Hello,

No, our XML editor support will only edit at install time your "app.settings" file created by Visual Studio. All you have to do is to add, in "Files and Folders" page, your "app.settings" file alongside your application.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”