Modify database access data in the app.config file after running the project "publish"

0

Hello, I created an application in C # and for access to the database I did the following: In the app.config file I have created the following:

<add name="MyDatabase"
    connectionString="server=192.168.10.100;user id=usuario;password=senha;database=nomeDataBase";providerName="MySql.Data.MySqlClient"/>

After that, in my code I called the connections like this:

var constring=ConfigurationManager.ConnectionStrings["Mydatabase"].ConnectionString;

So far so good, on the machine I developed this works perfectly, but if I take it to another host and try to change the mysql server (linux - 192.168.10.100) to another one on the network (linux also - 192.168.10.110) it does not connect, even by changing the App.config information. It's as if you're still with the test server data. How can I do to change these values since I will have to use more than one server in different cases and compiling and publishing the project sometimes is an unnecessary job.

    
asked by anonymous 10.01.2018 / 22:45

0 answers