Adding database strings

I have a windows application and I want to include a form that the user will access and change the strings to the database.
I assume that form will have the following entries:
Connection String
Server Name
I really would like to get a better logic of how this works. The application as it it now it has the settings of the computer I am working on and everytime I compile I have to change them from the properties box to allow them to work on another users computer. So if the application is installed in another location I would like to give the user to change the database settings / strings from a form within the application
I hope my question is clear.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

GrahamSkanConnect With a Mentor RetiredCommented:
Sorry I still don't undertand what problem you are having, so I could be missing the point.

1. Have a code start procedure, not a form
2. In the the start procedure, load the form modally
3. In the Form_Load Event have entries like this:

Form1.TextBox1.Text =  GetSetting("MyApplication", "MySettings", "Database Name", "")

It isn't clear what problem you are having.

However, you could make it easier if the relevant data were saved on on the computer, so that the boxes can be filled with the saved data. There are VB methods SaveSetting and GetSetting that can be used to keep the data in the registry between sessions of the application.

You should show the form modally. When the OK button is clicked, validate the data and close the form if it is all valid. Otherwise indicate what data is not acceptable (e.g. by showing a label adjacent to the invalid textbox). The Cancel button should end the application.

litewaysAuthor Commented:
Hi Graham....
How can I go about and work on the first part of your comment?
All Courses

From novice to tech pro — start learning today.