VistaDB 5
Gibraltar VistaDB > Getting Started > Migrating From Microsoft SQL Server > Getting Started - Migrating From SQL Server - ADO.NET Code
Getting Started - Migrating From SQL Server - ADO.NET Code

VistaDB is designed to be a drop-in substitute for Microsoft SQL Server for a .NET application.  If an application was developed to be data-provider agnostic then it's quite simple to switch between SQL Server and VistaDB.  Many applications (and sample code) are coupled to SQL Server by referencing its ADO.NET objects instead of the common base objects that are suitable in nearly all cases.  Similarly, when developing your VistaDB application you'll want to consider using the same base objects and not coupling tightly to VistaDB to make it easy to upsize customers to SQL Server when it's appropriate

Common ADO.NET Objects and their Equivalents

Base Object Description SQL Server Object VistaDB Equivalent
DbProviderFactory Represents a set of methods for creating instances of a provider's implementation of the data source classes. SqlClientFactory VistaDBProviderFactory
DbConnectionStringBuilder Provides a base class for strongly typed connection string builders. SqlConnectionStringBuilder VistaDBConnectionStringBuilder
DbCommandBuilder Automatically generates single-table commands used to reconcile changes made to a System.Data.DataSet with the associated database. This is an abstract class that can only be inherited. SqlCommandBuilder VistaDBCommandBuilder
DbCommand Represents an SQL statement or stored procedure to execute against a data source. Provides a base class for database-specific classes that represent commands. SqlCommand VistaDBConnection
DbConnection Represents a connection to a database. SqlConnection VistaDBConnection

Reads a forward-only stream of rows from a data source.

SqlDataReader VistaDBDataReader

Represents a parameter to a System.Data.Common.DbCommand and optionally, its mapping to a System.Data.DataSet column. For more information on parameters, see Configuring Parameters and Parameter Data Types (ADO.NET).

SqlParameter VistaDBParameter

The base class for a transaction.

SqlTransaction VistaDBTransaction

Where possible use the common base object to make it possible to move back and forth between different database providers without changing any application code.  This means you can swap DbDataReader for SqlDataReader and then work with either VistaDB or SQL Server.

See Also