public Contexto() { this.StrConexao = config.readDriverSQL(); //switch (GlobalDAL.Con) //{ // case "EquipamentosCia": // break; // default: // this.StrConexao = config.readDriverSQL(); // break; //} this.Con = new SqlConnection(StrConexao); try { // this.Con.Open(); // this.Con.Close(); } catch { // System.IO.File.WriteAllText(@System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "pegando_conexao_v2.txt", "Chegou aqui"); // // this.StrConexao = config.readDriverSQLV12(); // this.Con = new SqlConnection(StrConexao); // System.IO.File.WriteAllText(@System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "testando_conexao_v2.txt", "Chegou aqui"); // // this.Con.Open(); // this.Con.Close(); } }
private void Menu_Load(object sender, EventArgs e) { try{ Acesso db = new Acesso(); txtServer.Text = db.readDriverSQL().Substring(0, 18); // pictureBox1.Image = Image.FromFile(@"C:\One\image.png"); ================================ timer1.Enabled = true; txtUsu.Text = "Bem Vindo : " + global.nomeUsuario.ToString() + " (" + global.permissao + ")"; ValidarLicenca(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }