Connections::Add Method (String^)


Adds a ConnectionManager object of the specified connection type to the Connections collection.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

ConnectionManager^ Add(
	String^ connectionType


Type: System::String^

This parameter specifies the connection type. For example, the string "FILE" specifies a connection manager for files.

Return Value

Type: Microsoft.SqlServer.Dts.Runtime::ConnectionManager^

The new ConnectionManager object that was added to the Connections collection.

The value used for the connectionType parameter in this method is the value that is shown in the ConnectionManagerType property in the Designer. SQL Server (SSIS) includes several common connection types, including the following connection manager types:

  • ADO for accessing Microsoft ActiveX Data Objects (ADO) objects

  • ADO.NET for accessing ADO.NET objects

  • FILE for accessing files

  • FLATFILE for accessing data in flat files

  • HTTP for accessing a Web server

  • OLEDB for accessing relational data sources using OLE DB

  • ODBC for accessing databases using ODBC

  • Windows Management Instrumentation (WMI) for accessing a server and specifying the scope of management on the server

  • FTP for accessing a server to send and receive files

  • MSOLAP100 for accessing an instance of Microsoft SQL Server Analysis Services or an Analysis Services project

For more information about the valid connection type strings, see Integration Services (SSIS) Connections.

The following code sample adds an ADO.NET connection manager to a package that contains two existing connections.

No code example is currently available or this language may not be supported.

Sample Output:

The number of connections is: 2

The number of connections now is: 3

Return to top