Free Trial   |  Buy Online   |  Products   |  Downloads

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

  • C#
  • VB.NET
  • Delphi .NET

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

Installing Apollo into Visual Studio

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

  1. Run Visual Studio 2005 (or Visual Studio 2008)
  2. Create a new project or new form solution or use the one made by the Editor Wizard
  3. Select View Designer mode to see the application form in the editor
  4. Select the Toolbox icon and select the Data tab on the Toolbox
  5. Right-click and select "Add/Remove Items..."
  6. 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
  7. Click ok on the hilited items ApolloCommand, ApolloConnection, ApolloDataAdapter, ApolloDatabase, ApolloDataSet
  8. VS will hilite and install the Apollo components into the Toolbox dialog

Steps to building your first app

Creating your first .NET application

  1. Run VS 2005 (or VS 2008)
  2. Create a new Visual Studio C# or VB.NET WinForms application
  3. Drop ApolloDataAdapter onto the form. This will display the Apollo wizard.
  4. Click the Browse button and select the database "Test.DBF" and click OK.
  5. Click Continue and enter the following SQL statement:
      SELECT * FROM test
  6. Check "[x] Create UPDATE, INSERT and DELETE command automatically" to create update, insert and delete command objects automatically
  7. Check "[x] Auto-create DataSet" to automatically create the DataSet for the SQL query
  8. Drop a DataGrid control on the form and set its DataSource property to:
    apolloDataSet1.customer
  9. 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");
  10. 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");

Sample Code - .NET Data Provider

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

// Use the Apollo Data Provider as you would any other Data Provider
// Create a connection to a Apollo database
ApolloConnection conn = new ApolloConnection();
conn.ConnectionString = "Data Source = C:\\MyData\\MyDB.DBF";

// Set up a DataAdapter and Dataset for a table
ApolloDataAdapter adapterPerson = new ApolloDataAdapter();
DataSet dsPerson = new DataSet();
adapterPerson.SelectCommand = new ApolloCommand("SELECT * FROM Person", conn);

// Fill the DataAdapter with data and show it in the grid
dsPerson.Clear();
adapterPerson.Fill(dsPerson,"Person");
gridPerson.DataSource = dsPerson;
gridPerson.DataMember = "Person";

Sample Code - .NET - Direct Data Access Objects (DDA)

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

// Use the Apollo Direct Data Access objects
// Create a connection object to a Apollo database
ApolloDatabase vDB = new ApolloDatabase("C:\\MyData\\MyDB.DBF");

// Create a table object
ApolloTable vTable = new ApolloTable(vDB);
vTable.TableName = "Person";

// Define local vars to hold the data
string fname;
string lname;
boolean married;
integer age;

// Connect to the database and open the table
vDB.Connect();
vTable.Open();

// Traverse the table to get the records
while( !vTable.EndOfSet() ){
   fname = vTable.GetString( "FirstName");
   lname = vTable.GetString( "LastName");
   married = vTable.GetBoolean( "Married");
   age = vTable.GetInt32( "Age");
   WriteToScreen( fname, lname, married, age);

   // move to the next record
   vTable.Next();
};

// Close our connections
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

 


  Products Database Engine Getting Started Company
 
© Copyright 1999-2010 Vista Software. All rights reserved.