Enterprise Library DAAB – ADO.NET and Stored Procedures Made Easy
using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = connectionString; using (DbCommand selectCommand = factory.CreateCommand()) { selectCommand.CommandType = CommandType.StoredProcedure; selectCommand.CommandText = "SalesByCategory"; selectCommand.Connection = connection; DbParameter categoryParameter = selectCommand.CreateParameter(); categoryParameter.ParameterName = "@CategoryName"; categoryParameter.Value = "Beverages"; DbParameter yearParameter =…