public SqlDataReader ExecuteReader(string commandText) { SingletonConnection connection = SingletonConnection.GetInstance(); SqlCommand command = new SqlCommand(commandText, connection.Connection); SqlDataReader reader = command.ExecuteReader(); return(reader); }
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); }
public void Disconnect() { var connection = SingletonConnection.GetInstance(); connection.CloseConnection(); }