Data Access Layer (Stored Procedures & Data Adapter)
Stored Procedures
View sample stored procedures
Below are the stored procedures that will be used to Insert, Delete, Update,
and Retrieve data from your database. You can modify the Retrieval procedure to
support multiple retrieval parameters.
To add these procedures to your database, open Query Analyzer, paste the
content below and click on the "Run" menu option.
Grant Execute Statements (for the procs named above)
Data Adapter
Below is the C# code for the classes that will provide the data adapter for your domain
object. Please note below that a base class is used to create a more simple
implementation for multiple adapter classes. The base class contains most of the
logic for accessing your database and acts as a type of facade for your other data
adapters. Your various adapter classes should all inherit from this base class.
You should include these in a separate data project/assembly (e.g. Sales.Data).
Base Adapter (used by all of your adapter objects)
Data Adapter for this object (inherits BaseAdapter).