With VB.NET,
I'm developing an application that uses a MYSQL database. When I will deploy the application to another PC, the app and the MYSQL database will reside in difference computers.

What I'd like: After I install the app to a PC, when it first run, I want it to ask for database connection details (server,username,password,database e.t.c) then, save all of this to the Application Settings and use these everytime the app runs. I want the user to BE ABLE TO CHANGE these settings anytime (in case we change the mysql server e.t.c)

I can: I can code my app to write variables to the Application Settings and also read from them, but I can only work with settings with 'user' scope. If I'm not mistaken, these user-scope settings will not be there when the application is restarted. And this is why I think I need application scope settings, but VB says they are "Read only". I would like for these settings to be there permanently, but be specified by a user when the app runs and store them.

I once installed one library application which asked us to specify where the database is located, that was nice.

Any help on how I can deal with application scope settings? Or any alternatives?
Thanks.

If I'm not mistaken, these user-scope settings will not be there when the application is restarted.

You are misktaken.

User-Scoped settings would be pretty useless if they could not be saved. The default is for them to be saved on application shutdown, but you can also issue the statement My.Settings.Save() to force a save of their current state.

Edited 3 Years Ago by TnTinMN

Comments
Alright. Thank you. I see I got that wrong.

This has been asked and answered several times in this forum. Click on Search then enter application settings for the search string and vb.net for the forum.

This article has been dead for over six months. Start a new discussion instead.