Esempio n. 1
0
        public SqlDataReader ExecuteReader(string commandText)
        {
            SingletonConnection connection = SingletonConnection.GetInstance();
            SqlCommand          command    = new SqlCommand(commandText, connection.Connection);
            SqlDataReader       reader     = command.ExecuteReader();

            return(reader);
        }
Esempio n. 2
0
        public string GetTest()
        {
            Musica mus = new Musica();

            mus.Nome = "FRIENDS";
            var        connection = SingletonConnection.GetInstance().GetConnection(_configuration);
            string     sql        = "INSERT INTO musica(nome,autor, duracao)VALUES('all of me', 'bruno', '3:15')";
            SqlCommand command    = new SqlCommand(sql, connection);

            connection.Open();
            var status = command.ExecuteNonQuery().ToString();

            connection.Close();

            return(status);
        }
Esempio n. 3
0
        public void Disconnect()
        {
            var connection = SingletonConnection.GetInstance();

            connection.CloseConnection();
        }