コード例 #1
0
        public MensagemDAO()
        {
            StringConexaoDB stringConexaoDB = new StringConexaoDB();

            //conexao = new SqlConnection(stringConexao);
            conexao = new SqlConnection(stringConexaoDB.PathConexaoDB());
        }
コード例 #2
0
        public UsuarioDAO()
        {
            //string stringConexao = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\aulasCSharp\Udemy\Aula02\WebApp\WebApp\App_Data\Database.mdf;Integrated Security=True";
            //string stringConexao = @"Data Source = (localdb)\MSSQLLocalDB; Database = DBWattsAppApi; User ID = sa; Password = senha; TrustServerCertificate = True; Trusted_Connection = False; Connection Timeout = 300; Integrated Security = False; Persist Security Info = False; Encrypt = false; MultipleActiveResultSets = True;";
            //return;
            StringConexaoDB stringConexaoBd = new StringConexaoDB();

            //conexao = new SqlConnection(stringConexao);
            conexao = new SqlConnection(stringConexaoBd.PathConexaoDB());
            conexao.Open();
        }