I'm new to C# development. I am familiar with setting up connection strings and working with databases in ADO in VB6, but this is a bit more involved.
I have a very basic application in which I created a connection to a production database table with three fields. I drug the table onto the form and was pleasantly surprised to see how it not only created the table on the form, but also gave me navigation controls. Unfortunately, now I want to add a toolbar button that allows the user to switch between the production and testing databases by changing the connection string, clear the contents of the cells, and refill them with the information from the new string.
My plan was very basic, using a messagebox. If the dialog result was OK, select the production database. If Cancel, select the test database. In the method to handle the button click, I got so far as to have the If..Else statement after getting the dialog result, but for the life of me, I can't find a way to change the string for the connection string.
Bear with me as I'm very new to C#. Any links/help would be appreciated.