Which pattern is better for SqlConnection object?
问题 Which pattern is better for SqlConnection object? Which is better in performance? Do you offer any other pattern? class DataAccess1 : IDisposable { private SqlConnection connection; public DataAccess1(string connectionString) { connection = new SqlConnection(connectionString); } public void Execute(string query) { using (SqlCommand command = connection.CreateCommand()) { command.CommandText = query; command.CommandType = CommandType.Text; // ... command.Connection.Open(); command