Data Providers
Data Providers
1 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
Search
Tuesday, June 19, 2012
Site Navigation
..::
Technology
Connection Strings
::..
Register Login
Home
Personal
Technology
Connection Strings
.NET Data Providers
OLE DB Providers
ODBC Providers
ODBC DSN-Less
DataShape Provider
OLE DB Providers
RDS
Contact Me
Oracle Provider
- From Oracle
Oracle Provider
- From CoreLab
Postgre SQL Direct
- From CoreLab
Sybase ASE
VistaDB Provider
The Microsoft SQL Server .NET Data Provide allows you to connect to a Microsoft
SQL Server 7.0, 2000, and 2005 databases.
For Microsoft SQL Server 6.5 or earlier, use the OLE DB .NET Data Provider with
the SQL Server OLE DB
Provider (SQLOLEDB).
Using C#:
using System.Data.SqlClient;
...
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString = "Data Source=(local);" +
"Initial Catalog=myDatabaseName;" +
"Integrated Security=SSPI";
//Or
// "Server=(local);" +
// "Database=myDatabaseName;" +
// "Trusted_Connection=Yes";
oSQLConn.Open();
...
oSQLConn.Close();
//
//
//
//
19/06/2012 17:53
2 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
Using VB.NET:
Imports System.Data.SqlClient
...
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString = _
"Data Source=(local);" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"
oSQLConn.Open()
oSQLConn.ConnectionString = _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
oSQLConn.Open()
Where:
Note: Microsoft
SQLXML Managed Classes exposes the functionality of SQLXML inside the Microsoft
.NET Framework.
19/06/2012 17:53
3 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
MySQLDirect .NET is data provider to direct access to MySQL database server for
the Microsoft .NET Framework and .NET Compact Framework. It is completely based
on ActiveX Data Objects for the .NET Framework (ADO.NET) technology. ADO.NET
provides
a rich set of components for creating distributed, data-sharing applications. It
is an integral part of the .NET Framework, providing access to relational data,
XML, and application data.
MySQLDirect .NET data provider can be used in the same way as the SQL Server .NET
or the OLE DB .NET Data Provider. Data provider can access MySQL server either using
native MySQL network protocol directly or through MySQL client library. It allows
to create lightweight and fast applications working with MySQL.
Using C#
using CoreLab.MySql;
...
MySqlConnection oMySqlConn = new MySqlConnection();
oMySqlConn.ConnectionString = "User ID=myUsername;" +
"Password=myPassword;" +
"Host=localhost;" +
"Port=3306;" +
"Database=myDatabaseName;" +
"Direct=true;" +
"Protocol=TCP;" +
"Compress=false;" +
"Pooling=true;" +
"Min Pool Size=0;" +
"Max Pool Size=100;" +
"Connection Lifetime=0";
oMySqlConn.Open();
Using VB.NET
Imports CoreLab.MySql
...
Dim oMySqlConn As MySqlConnection = New MySqlConnection()
oMySqlConn.ConnectionString = _
"User ID=myUsername;" & _
"Password=myPassword;" & _
"Host=localhost;" & _
"Port=3306;" & _
"Database=myDatabaseName;" & _
"Direct=true;" & _
"Protocol=TCP;" & _
"Compress=false;" & _
"Pooling=true;" & _
"Min Pool Size=0;" & _
"Max Pool Size=100;" & _
"Connection Lifetime=0"
oMySqlConn.Open()
19/06/2012 17:53
4 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
here.
The Open Database Connectivity (ODBC) .NET Data Provider provides access to native
ODBC drivers the same way the OLE DB .NET Data Provider provides access to native
OLE DB providers.
19/06/2012 17:53
5 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
The Microsoft .NET Framework Data Provider for OLE DB allow you to use native OLE
DB providers (e.g. Microsoft.JET.OLEDB.4.0) through COM interop to enable data access.
19/06/2012 17:53
6 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
19/06/2012 17:53
7 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
The Microsoft .NET Framework Data Provider for Oracle is an add-on component to
the .NET Framework 1.0 that provides access to an Oracle database using the Oracle
Call Interface (OCI) as provided by Oracle Client software. Oracle 8i Release 3
(8.1.7) Client or later must be installed for this provider to function correctly.
Using C#:
using System.Data.OracleClient;
...
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "Data Source=Oracle8i;" +
"Integrated Security=SSPI";
oOracleConn.Open();
Using VB.NET:
Imports System.Data.OracleClient
...
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = "Data Source=Oracle8i;" & _
"Integrated Security=SSPI";
oOracleConn.Open()
19/06/2012 17:53
8 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
The Oracle Data Provider for .NET (ODP.NET) features optimized data access to the
Oracle database from a .NET environment. ODP.NET allows developers to take advantage
of advanced Oracle database functionality, including Real Application Clusters,
XML DB, and advanced security. The data provider can be used from any .NET language,
including C# and Visual Basic .NET.
ODP.NET makes using Oracle from .NET more flexible, faster, and more stable. ODP.NET
includes many features not available from other .NET drivers, including Multiple
Active Result Sets (MARS), a native XML data type, the ability to bind array parameters,
and flexible LOB tuning. ODP.NET is designed for scalable enterprise Windows solutions
by providing full support for Unicode and local and distributed transactions. Distributed
transactions are supported using the Oracle Services for MTS.
Using C#
using Oracle.DataAccess.Client;
...
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "Data Source=MyOracleServerName;" +
"Integrated Security=SSPI";
oOracleConn.Open();
Using VB.NET
Imports Oracle.DataAccess.Client
...
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = _
"Data Source=MyOracleServerName;" & _
"Integrated Security=SSPI";
oOracleConn.Open();
19/06/2012 17:53
9 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
OraDirect .NET is a data provider to direct access to Oracle database server for
the Microsoft .NET Framework and .NET Compact Framework. It is completely based
on ActiveX Data Objects for the .NET Framework (ADO.NET) technology. ADO.NET
provides
a rich set of components for creating distributed, data-sharing applications. It
is an integral part of the .NET Framework, providing access to relational data,
XML, and application data.
OraDirect .NET data provider can be used in the same way as the SQL Server .NET
or the OLE DB .NET Data Provider. OraDirect .NET can access Oracle server using
Oracle Call Interface (OCI) or through TCP/IP directly.
Using C#
using CoreLab.Oracle;
...
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "User ID=myUsername;" +
"Password=myPassword;" +
"Host=(local);" +
"Pooling=true;" +
"Min Pool Size=0;" +
"Max Pool Size=100;" +
"Connection Lifetime=0";
oOracleConn.Open();
Using VB.NET
Imports CoreLab.Oracle
...
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = "User ID=myUsername;" & _
"Password=myPassword;" & _
"Host=(local);" & _
"Pooling=true;" & _
"Min Pool Size=0;" & _
"Max Pool Size=100;" & _
"Connection Lifetime=0"
oOracleConn.Open()
19/06/2012 17:53
10 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
PostgreSQLDirect .NET data provider can be used in the same way as the SQL Server
.NET or the OLE DB .NET Data Provider.
Using C#
using CoreLab.PostgreSql;
...
PgSqlConnection oPgSqlConn = new PgSqlConnection();
oPgSqlConn.ConnectionString = "User ID=myUsername;" +
"Password=myPassword;" +
"Host=localhost;" +
"Port=5432;" +
"Database=myDatabaseName;" +
"Pooling=true;" +
"Min Pool Size=0;" +
"Max Pool Size=100;" +
"Connection Lifetime=0";
oPgSqlConn.Open();
Using VB.NET
Imports CoreLab.PostgreSql
...
Dim oPgSqlConn As PgSqlConnection = New PgSqlConnection()
oPgSqlConn.ConnectionString = "User ID=myUsername;" & _
"Password=myPassword;" & _
"Host=localhost;" & _
"Port=5432;" & _
"Database=myDatabaseName;" & _
"Pooling=true;" & _
"Min Pool Size=0;" & _
"Max Pool Size=100;" & _
"Connection Lifetime=0"
oPgSqlConn.Open()
19/06/2012 17:53
11 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
Using C#
using Sybase.Data.AseClient;
...
AseConnection oAseConn = new AseConnection();
oAseConn.ConnectionString = "Data Source=(local);" +
"Initial Catalog=myDatabaseName;" +
"User ID=myUsername;" +
"Password=myPassword"
oAseConn.Open();
Using VB.NET
Imports System.Data.AseClient
...
Dim oAseConn As AseConnection = New AseConnection()
oAseConn.ConnectionString = "Data Source=(local);" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
oAseConn.Open()
VistaDB (VistaDB.Provider)
The VistaDB
Provider allows you to access a VistaDB
database.
Using C#
using VistaDB.Provider;
...
string connectionString = @"Data Source = C:\VistaDB.vdb3;
Open Mode = ExclusiveReadWrite";
VistaDBConnection connection = new VistaDBConnection(connectionString);
connection.Open();
Using VB.NET
Imports VistaDB.Provider
...
Dim vistaDBConnection As VistaDBConnection = New VistaDBConnection()
19/06/2012 17:53
12 of 12
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedP...
19/06/2012 17:53