Example:
Access: typeof(System.Data.Odbc), "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=Northwind.mdb"
DB2: typeof(IBM.Data.DB2), "server=db2.windwardreports.com;database=SAMPLE;Uid=demo;Pwd=demo;"
Excel: typeof(System.Data.OleDb), "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Northwind Mini - Data.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\""
MySql: typeof(MySql.Data.MySqlClient), "server=mysql.windwardreports.com;database=sakila;user id=demo;password=demo;"
ODBC: typeof(System.Data.Odbc), "Driver={Sql Server};Server=localhost;Database=Northwind;User ID=test;Password=pass;"
OleDB: typeof(System.Data.OleDb), "Provider=sqloledb;Data Source=localhost;Initial Catalog=Northwind;User ID=test;Password=pass;"
Oracle: typeof(Oracle.DataAccess.Client), "Data Source=oracle.windwardreports.com:1521/HR;Persist Security Info=True;Password=HR;User ID=HR"
Do not use System.Data.OracleClient - even Microsoft discourages its use.
SqlServer: typeof(System.Data.SqlClient), "Data Source=mssql.windwardreports.com;Initial Catalog=Northwind;user=demo;password=demo;"
Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal type As Type, _ ByVal connectionString As String _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim type As Type Dim connectionString As String Dim instance As New AdoDataSourceImpl(type, connectionString) |
C# | |
---|---|
public AdoDataSourceImpl( Type type, string connectionString ) |
Managed Extensions for C++ | |
---|---|
public: AdoDataSourceImpl( Type* type, string* connectionString ) |
C++/CLI | |
---|---|
public: AdoDataSourceImpl( Type^ type, String^ connectionString ) |
Parameters
- type
- The type of the DbConnection driver. For example, for SqlServer this would be typeof(SqlConnection).
- connectionString
- The connection string used in the DbConnection constructor.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP, Windows Vista, Windows Server 2003 family