Db Class

Design Pattern Framework 3.5

Design Pattern Framework 3.5 Db Class
Class that manages all lower level ADO.NET data base access.
Declaration Syntax
C# Visual Basic
public static class Db
Public NotInheritable Class Db
Members
All Members Methods



Icon Member Description
Escape(String)
Escapes an input string for database processing, that is, surround it with quotes and change any quote in the string to two adjacent quotes (i.e. escape it). If input string is null or empty a NULL string is returned.

Escape(String, Int32)
Escapes an input string for database processing, that is, surround it with quotes and change any quote in the string to two adjacent quotes (i.e. escape it). Also trims string at a given maximum length. If input string is null or empty a NULL string is returned.

GetDataRow(String)
Populates a DataRow according to a Sql statement.

GetDataSet(String)
Populates a DataSet according to a Sql statement.

GetDataTable(String)
Populates a DataTable according to a Sql statement.

GetScalar(String)
Executes a Sql statement and returns a scalar value.

Insert(String, Boolean)
Executes Insert statements in the database. Optionally returns new identifier.

Insert(String)
Executes Insert statements in the database.

Update(String)
Executes Update statements in the database.

Remarks
GoF Design Patterns: Singleton, Factory, Proxy. This class is the 'swiss army knife' of data access. It handles all database access details and shields its complexity from its clients. The Factory Design pattern is used to create database specific instances of Connection objects, Command objects, etc. This class is like a Singleton -- it is a static class (Shared in VB) and therefore only one 'instance' ever will exist. This class is a Proxy in that it 'stands in' for the actual DbProviderFactory.
Inheritance Hierarchy
Object
Db

Assembly: DataObjects (Module: DataObjects) Version: 1.0.0.0 (1.0.0.0)