Related Links

 


VistaDB 3 box shot

  • XCopy deployable TSQL Engine
  • Less than 1 MB single assembly deployment
  • Easy migration from SQL Server TSQL data types and syntax
  • Royalty free distribution. Licensed per developer
  • TSQL Procs for ease of migration to SQL Server
  • ASP.NET and Medium Trust supported for shared hosting

Sample of VistaDB Code

What does VistaDB code look like?  We have two different API's you can use to write your code.  One is the standard ADO.NET 2 provider syntax (SQL), and the other is Direct Data Access (DDA).

ADO.Net Provider - For users who are used to programming against SQL Server and are looking for a lightweight alternative.

DDA Provider - For users who are new to database programming, or coming from an XBase (Apollo, FoxPro) background.  DDA is an easy to use cursor based programming model.

Please view the tutorials page for many more examples of both programming APIs.

Samples Included

Over 30 sample applications are included with the free trial showing how to use both DDA and ADO.NET objects. Most examples are provided in C# and VB.Net.

.Net Logo  ADO.NET Data Provider

The built-in VistaDB.ADO.NET Provider is fully compatible with ADO.NET 2.0. It provides full support for disconnected SQL-based data management, exactly like the SqlClient Provider. The VistaDB ADO.NET Provider components include VistaDBConnection, VistaDBDataAdapter, VistaDBDataReader, VistaDBCommand and each work with databound controls and 3rd party products that support ADO.NET managed provider factories.

If you are used to programming against SQL Server this is probably the API you should use.

C# sample using the VistaDB ADO.NET Data Provider

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

// Set up a DataAdapter and Dataset for a table
VistaDBDataAdapter adapterPerson = new VistaDBDataAdapter();
DataSet dsPerson = new DataSet();
adapterPerson.SelectCommand = new VistaDBCommand("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";



.Net Logo  Direct Data Access (DDA)

Direct Data Access™ objects or DDA is unique to VistaDB. DDA consists of 3 .NET objects: VistaDBDatabase, VistaDBTable and the VistaDBDataSet that give you total control over a .VDB3 database. These classes provide an intuitive, yet powerful object-oriented method of managing data, sometimes referred to as "live cursors", "scrollable cursors" or "navigational control". DDA lets you navigate dynamically through data tables without having to load the entire table or dataset into memory. DDA provides more performance over ADO.NET's disconnected data model. The VistaDBDataSet allows DDA to be fully compatible with all databound controls.

You are new to database programming, or coming from another cursor based database environment this is probably the API you should use.

C# sample using the VistaDB DDA objects

// Use the VistaDB Direct Data Access objects
IVistaDBDDA DDAObj = VistaDBEngine.Connections.OpenDDA();

// Create a connection object to a VistaDB database
IVistaDBDatabase vDB = DDAObj.OpenDatabase("C:\\MyData\\MyDB.vdb", VistaDBDatabaseOpenMode.ExclusiveReadWrite, null);

// Open the table
IVistaDBTable vTable = vDB.OpenTable("Person", false, false);

// Define local vars to hold the data

string fname;
string lname;
bool married;
int age;

// Traverse the table to get the records
while( !vTable.EndOfTable )
{

fname = Convert.ToString( vTable.Get("FirstName") );
lname = Convert.ToString(vTable.Get("LastName"));
married = Convert.ToBoolean( vTable.Get( "Married"));
age = Convert.ToInt32( vTable.Get( "Age") );
Console.WriteLine( "{0} {1} {2} {3}", fname, lname, married, age);

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

}

// Close our connections
vTable.Close();
vTable.Dispose();
vTable = null;
vDB.Close();