private void cb_connexion_SelectedIndexChanged(object sender, EventArgs e) { int x = cb_connexion.SelectedIndex; if (x >= -1) { groupBox1.Enabled = true; tb_name.Text = tb_connectionstring.Text = tb_database.Text = tb_fichier.Text = tb_login.Text = tb_password.Text = tb_port.Text = tb_server.Text = ""; int y = QueryLauncher.GetSGBD(QueryLauncher.connexions[x].SGBD.ToString()); if (y > -1) { cb_database.SelectedIndex = y; } tb_name.Text = QueryLauncher.connexions[x].Name; tb_server.Text = QueryLauncher.connexions[x].Server; tb_port.Text = QueryLauncher.connexions[x].Port.ToString(); tb_database.Text = QueryLauncher.connexions[x].Database; tb_login.Text = QueryLauncher.connexions[x].Login; tb_password.Text = QueryLauncher.connexions[x].Password; tb_fichier.Text = QueryLauncher.connexions[x].Fichier; tb_connectionstring.Text = QueryLauncher.connexions[x].ConnectionString; } }
public String BuildConnectionString() { String connectionString = ""; SGBD s = QueryLauncher.sgbds[QueryLauncher.GetSGBD(SGBD)]; connectionString = s.DefaultConnectionString.Replace("{server}", Server) .Replace("{login}", Login) .Replace("{password}", Password) .Replace("{database}", Database) .Replace("{port}", Port.ToString()) .Replace("{fichier}", Fichier); return(connectionString); }