public type | description |
---|---|
class DAL | The data access between the data layer and the database. (Implements IDAL) |
interface IDAL | The data access between the data layer and the database. |
public class DAL : IDAL
name | description |
---|---|
DAL(…) | Initializes a new instance of the DAL class with the passed connectionString. |
ExecuteStoredProcedure(…) | Executes a stored procedure with parameters. (Inherited from IDAL) |
GetValueFromStoredProcedure(…) | Executes a stored procedure with parameters, returning a single value. (Inherited from IDAL) |
GetTableFromStoredProcedure(…) | Executes a stored procedure with parameters, returning a DataTable. (Inherited from IDAL) |
Initializes a new instance of the DAL
class with the passed connectionString
.
public DAL(string connectionString)
parameter | description |
---|---|
connectionString | The connection string to use for any SqlConnection . |
exception | condition |
---|---|
ArgumentNullException | Thrown when the passed connectionString is null . |
The data access between the data layer and the database.
public interface IDAL
name | description |
---|---|
ExecuteStoredProcedure(…) | Executes a stored procedure with parameters. |
GetValueFromStoredProcedure(…) | Executes a stored procedure with parameters, returning a single value. |
GetTableFromStoredProcedure(…) | Executes a stored procedure with parameters, returning a DataTable. |
Executes a stored procedure with parameters.
public void ExecuteStoredProcedure(
string storedProcedureName,
IDictionary<string, object> parameters
)
parameter | description |
---|---|
storedProcedureName | The name of the stored procedure to execute. |
parameters | A dictionary of the parameters to pass to the stored procedure. |
Executes a stored procedure with parameters, returning a single value.
public object GetValueFromStoredProcedure(
string storedProcedureName,
IDictionary<string, object> parameters
)
The single scalar value returned from the stored procedure.
Executes a stored procedure with parameters, returning a DataTable
.
public DataTable GetTableFromStoredProcedure(
string storedProcedureName,
IDictionary<string, object> parameters
)
The first DataTable
in the result set returned from the stored
procedure.