Database Connectivity

Top  Previous  Next

To link DbNetGrid or DbNetEdit to a database you will need to specify the ConnectionString property. This property refers to a name attribute  of an element in the <ConnectionStrings> section of the web.config file. e.g.

<?xml version="1.0"?>
<configuration>
       <connectionStrings>
               <add name="SamplesDatabase" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=~/App_Data/dbnetsuitevs.mdb"/>
       </connectionStrings>
       ...
</configuration>

 

The connectionString attribute defines the actual ADO.NET connection string used to connect to the database. The connection string can include a special property called DataProvider which can be used to specify the ADO.NET Data Provider used to make the connection.

 

DbNetSuiteVS supports the following databases.

 

Supported Databases

SQL Server

Connection strings for SQL Server are assigned in one of two formats depending on whether you want to connect using Windows or SQL Server authentication.

Using Windows authentication

Server=ServerName;Database=DatabaseName;Trusted_Connection=true;

Using SQL Server authentication

Server=ServerName;Database=DatabaseName;UID=username;PWD=password;

 

Provider

SqlClient

Access

Data source property should specify the path to an Access MDB file

Example connection string

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\data\msjet\hr.mdb

Provider

OleDb

Access 2007

Data source property should specify the path to an Access ACCMB file.

Example connection string

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\data\access2007\Marketing projects.accdb

Provider

OleDb

 

Note that connection to the new Access 2007 ACCMB file format requires the 2007 Office Data Connectivity Components to be installed

Oracle

Connection strings for Oracle are assigned in one of two formats depending on whether you want to connect using Windows or Oracle authentication. The Data Source refers to

Using Windows authentication

Example connection string

Server=//server4/XE;Integrated Security=SSPI;DataProvider=OracleClient;

Using SQL Server authentication

Example connection string

Server=//server4/XE;User ID=nwind;Password=nwind;DataProvider=OracleClient;

Provider

OracleClient

MySql

Example connection string

Server=servername;Port=3306;Database=databasename;User ID=username;Password=password;DataProvider=MySql;

Provider

MySQL

DB2

Example connection string

Server=Servername;Database=DatabaseName;uid=username;pwd=password;CurrentSchema=schemaname;DataProvider=DB2;

Provider

DB2

Visual FoxPro

Connection requires the Visual FoxPro OleDb driver which can be downloaded from here

Example connection string

Provider=vfpoledb;data source=/data/vfp/northwind/northwind.dbc;DataProvider=OleDb;

Provider

OleDb

VistaDB

Connection requires the VistaDB .NET data provider.

Example connection string

Data Source=/data/vistadb/northwind.vdb3;DataProvider=VistaDB;

Provider

VistaDB

dBASE

Connection requires the MS JET OleDB driver (specifying DBASE in the Extended Properties property)

Example connection string

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\GoldMine\Demo;Extended Properties=DBASE IV;

Provider

OleDb

Pervasive

Connection requires the Pervasive .Net Data Provider

Example connection string

Server=ServerName;ServerDSN=DataSetName;DataProvider=Pervasive;

Provider

Pervasive

Firebird

Connection requires the Firebird .Net Data Provider

Example connection string

Server=ServerName;Database=C:\firebird\nwind\nwind.FDB;User ID=sysdba;Password=masterkey;DataProvider=Firebird;

Provider

Firebird

Postgresql

Connection requires the Npgsql Data Provider

Example connection string

server=localhost;User Id=postgres;Password=postgres;Database=northwind;Port=5432;DataProvider=Npgsql;

 

Data Providers

SqlClient
Provider for connections to SQL Server.

Availability

Included with the .Net Framework

OleDb

Provider for connections to Access and Visual FoxPro.

Availability

Included with the .Net Framework

OracleClient

Provider for connections to Oracle. Also requires the installation of the Oracle Call Interface (OCI) on the client.

Availability

Included with the .Net Framework

MySql

Provider for connections to MySql.

Availability

Download from the MySql web site

DB2

Provider for connections to DB2.  Also requires the installation of the DB2 client.

Availability

Download as part of the IBM DB2 Client

VistaDB

Provider for connections to VistaDB.

Availability

Download from the VistaDB web site

 

Pervasive

Provider for connections to Pervasive.

Availability

Download from the Pervasive web site

 

Firebird

Provider for connections to Firebird.

Availability

Download from the Firebird web site

Odbc

Connect to one of the supported databases using an ODBC DSN

Availability

Included with the .Net Framework

 

Npgsql(PostgreSql)

Data Provider for connections to PostgreSql.

Availability

Download from the PgFoundry web site