FireBird SqlHelper - A Data Access Application Block for FireBird
FireBird.SqlHelper is a C# porting of Microsoft Data Access Application Block V2. Just like the Microsoft Data Access Application Block V2, FireBird.SqlHelper encapsulates performance and resource management best practices and can easily be used as a building block in your own .NET FireBird applicat

Introduction
FireBird.SqlHelper
is a C# porting of Microsoft Data Access Application Block V2. Just like the Microsoft Data Access Application Block V2, FireBird.SqlHelper
encapsulates performance and resource management best practices and can easily be used as a building block in your own .NET FireBird
application. If you use it, you will reduce the amount of custom code you need to create, test and maintain.
Features
A pre-written data access library is always handy. Basically FireBird SqlHelper
has similar features as MSDAB. Following are the important features: The FireBird SqlHelper
Data Access Application Block for .NET consists of a single .NET-based assembly, which contains all of the functionality necessary to perform the most common data access tasks against a FireBird
database. Specifically, the Data Access Application Block helps you:
- Call stored procedures or SQL text commands
- Specify parameter details
- Return
SqlDataReader
,DataSet
objects, or single values - Use strongly typed table and field names
- Support parameter caching, where required
- Allow additional tables to be added by passing in pre-existing datasets
- Update a dataset with user-specified update commands
- Create
SqlCommand
objects - Allow strongly typed data rows to be passed in place of parameters
Using the Code
Compile FireBird.SqlHelper
project and add the reference of FireBird.SqlHelper.dll in your application. Following are the important methods that you could use:
ExecuteNonQuery
- Executes a command that does not return rowsExecuteDataset
- Executes a command that returns rows as aDataSet
ExecuteReader
- Executes a command that returns rows as aSqlDataReader
ExecuteScalar
- Executes a command that returns a single value as an objectFillDataset
- Executes a command that populates aDataSet
that is provided as a parameterUpdateDataset
- Executes a given command for each inserted, updated, or deleted row in aDataSet
CreateCommand
- Creates a command object given a stored procedure and parametersExecuteNonQueryTypedParams
- Executes a command that does not return rows using aDataRow
’s column values as parametersExecuteDatasetTypedParams
- Executes a command that returns rows as aDataSet
using aDataRow
’s column values as parametersExecuteReaderTypedParams
- Executes a command that returns rows as aSqlDataReader
using aDataRow
’s column values as parameters.ExecuteScalarTypedParams
- Executes a command that returns a single value as an object using aDataRow
’s column values as parameters.
The following code is from the demo application:
private void RefreshData()
{
this.dataGridView1.DataSource =
SqlHelper.ExecuteDataset(SQLHelp.Connectionstring, CommandType.Text,
"SELECT * FROM COUNTRY").Tables[0];
}
You could call a stored procedure like:
SqlHelper.ExecuteReader(connectionString, "getProductsByCategory", categoryID);
You could download MSDAB V2 with documentation from here.
The documentation along with MSDAB covers everything about the SqlHelper
class which also applies to FireBird SqlHelper
.
There are also a great deal of samples available for MSDAB V2 which you could also use for FireBird SQLHelper
.
History
- 17th January, 2007: Initial post