Apollo 7 - .NET Data Provider
Included with Apollo 7
Overview
The Apollo .NET Data Provider is a fully managed .NET
Data Provider that lets .NET developers build WinForm and ASP.NET applications
for .NET 1.1, 2.0, 3.0 and 3.5. Supports C#, VB.NET and other CLR-compliant
languages using Visual Studio and Borland Developer Studio.
Key Features
- Create WinForms and ASP.NET applications
- Create, update and manage Clipper and FoxPro DBF/Xbase
database files from code
- Compatible with .NET data bound controls and 3rd
party components
- Easily scalable from embedded to client/server
configuration with 5 lines of code
- Samples with full source code
- Royalty free unlimited distribution
Supported IDEs
- Visual Studio 2008
- Visual Studio 2005
- Visual Studio .NET 2003
- Delphi 2009
- Delphi 2007
- Delphi 2006
Supported Languages
Supported .NET Frameworks
- .NET 3.5
- .NET 3.0
- .NET 2.0
- .NET 1.1
Components
ADO.NET Data Provider
- ApolloDataAdapter
Works like SqlClient.
Fills datasets with data defined by SQL commands and queries from
ApolloCommands.
- ApolloCommand
Works much like SqlCommand.
Runs SQL-92 queries and commands to manage Clipper and FoxPro 2.6 data. The
Query object supports all the common SQL statements such as SELECT, INSERT,
UPDATE, DELETE and more.
- ApolloConnection
Works much like
SqlConnection. Connects to DBF/Xbase database files and allows you to manage database
level settings such as encryption.
- ApolloDataSet
Unique to Apollo. Works much
like DataSet. Connects databound controls to DBF/Xbase data tables using high-speed,
low overhead DDA objects. More efficient than the standard .NET disconnected
datasets yet provides all the convenience of databound controls support,
including the DataGrid.
- ApolloDataReader (non-visual)
Works much
like SqlDataReader. ApolloTable is modeled after DataSet to provide direct data
access with live data cursors to Apollo tables without the overhead of ADO.NET.
ApolloTable provides high speed direct table access that is faster than
ADO.NET.
Direct Data Access Objects
- ApolloTable (DDA non-visual)
Unique to
Apollo. ApolloTable is modeled after Dataset to provide direct data access with
live data cursors to Apollo tables without the overhead of ADO.NET. Connects to
Apollo tables allowing you to add, delete, update, filter and find data, along
with other table related operations. ApolloTable provides high speed direct
table access that is faster than ADO.NET.
- ApolloDatabase (DDA non-visual)
Unique to
Apolla. ApolloDatabase works with ApolloTable to provide direct data access to
DBF/Xbase data files without the overhead of ADO.NET.
Using & Sample Code
Applies to Visual Studio 2003, 2005 and 2008, .NET
1.1, .NET 2.0, .NET 3.0 and .NET 3.5
Installing Apollo into Visual Studio 2005 or Visual
Studio 2008
- Run Visual Studio 2005 (or Visual Studio 2008)
- Create a new project or new form solution or use
the one made by the Editor Wizard
- Select View Designer mode to see the application
form in the editor
- Select the Toolbox icon and select the Data tab on
the Toolbox
- Right-click and select "Add/Remove Items..."
- In the Customize Toolbox dialog, press the Browse
button and select one of the following:
for Visual Studio 2005 (.NET
2.0): C:\Program Files\Apollo7\NET
2.0\Provider\Apollo.Provider.DLL
- Click ok on the hilited items ApolloCommand,
ApolloConnection, ApolloDataAdapter, ApolloDatabase, ApolloDataSet
- VS will hilite and install the Apollo components
into the Toolbox dialog
Creating your first .NET application
- Run VS 2005 (or VS 2008)
- Create a new Visual Studio C# or VB.NET WinForms
application
- Drop ApolloDataAdapter onto the form. This will
display the Apollo wizard.
- Click the Browse button and select the database
"Test.DBF" and click OK.
- Click Continue and enter the following SQL
statement:
SELECT * FROM test
- Check "[x] Create UPDATE, INSERT and DELETE command
automatically" to create update, insert and delete command objects
automatically
- Check "[x] Auto-create DataSet" to automatically
create the DataSet for the SQL query
- Drop a DataGrid control on the form and set its
DataSource property to:
apolloDataSet1.customer
- Drop a Button on the form and name it "Fill".
Double click on the button and enter the following code to fill the dataset
with data from from database:
apolloDataSet1.Clear();
apolloDataAdapter1.Fill(apolloDataSet1, "customer");
- Drop a 2nd Button on the form and name it "Update".
Double click on the button and enter the following code to update the database
from data set:
apolloDataAdapter1.Update(apolloDataSet1,
"customer");
Apollo .NET Data Provider is compatible with the
ADO.NET architecture and provides SQL-92 support for disconnected SQL-based
data management, exactly like the SqlClient Provider. The Apollo .NET Data
Provider components include ApolloConnection, ApolloDataAdapter,
ApolloDataReader, ApolloCommand and each work with databound controls and 3rd
party products that support ADO.NET.
C# sample using the Apollo Data Provider
ApolloConnection conn = new
ApolloConnection(); conn.ConnectionString = "Data Source =
C:\\MyData\\MyDB.DBF";
ApolloDataAdapter adapterPerson = new
ApolloDataAdapter(); DataSet dsPerson = new
DataSet(); adapterPerson.SelectCommand = new ApolloCommand("SELECT * FROM
Person", conn);
dsPerson.Clear(); adapterPerson.Fill(dsPerson,"Person"); gridPerson.DataSource
= dsPerson; gridPerson.DataMember = "Person";
DDA is unique to Apollo. DDA consists of 3 .NET
objects: ApolloDatabase, ApolloTable and the ApolloDataSet. Together, these
objects give you total control over a DBF/Xbase database and provide an intuitive,
yet powerful object-oriented method of managing data, sometimes referred to as
"live cursors" or "navigational control". DDA lets you navigate dynamically
through data tables without having to load the entire table or dataset into
memory. This gives DDA a big boost in performance over ADO.NET's disconnected
data model. The ApolloDataSet allows DDA to be fully comaptible with all databound
controls.
C# sample using the Apollo DDA objects
ApolloDatabase vDB = new
ApolloDatabase("C:\\MyData\\MyDB.DBF");
ApolloTable vTable = new
ApolloTable(vDB); vTable.TableName = "Person";
string
fname; string lname; boolean married; integer age;
vDB.Connect(); vTable.Open();
while(
!vTable.EndOfSet() ){ fname = vTable.GetString(
"FirstName"); lname = vTable.GetString(
"LastName"); married = vTable.GetBoolean(
"Married"); age = vTable.GetInt32(
"Age"); WriteToScreen( fname, lname, married,
age);
vTable.Next(); };
vTable.Close(); vDB.Close();
Architecture Diagrams
Single User - Local Access |
 |
| |
Single User - File Share or LAN Data
Access |
 |
| |
Multiple Users - File Share or LAN Data
Access |
 |
| |
Multiple Users - Web Data Access |
 |
| |
Multiple Users - Client/Server Access |
 |
| |
Multiple Users - Client/Server Access with Apollo
Relay Server |
 |
|