Windward Studios API Reference
AdoDataSourceImpl Constructor(Type,String)
See Also  Send comments on this topic.
net.windward.api.csharp Namespace > AdoDataSourceImpl Class > AdoDataSourceImpl Constructor : AdoDataSourceImpl Constructor(Type,String)




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.

Glossary Item Box

Create a DataSourceProvider that uses Ado to access a SQL database. This constructor calls new DbConnection(connectionString) to create a connection. Each forEach and query tag will also cause a connection to be created.
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;"

Syntax

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 10, Windows NT, Windows Server

See Also

Windward Studios - .NET Document Generation software