Share via


ISqlActivationService.CreateInstance<T> Method (Type, array<Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

Namespace:  Microsoft.SqlServer.Management
Assembly:  SqlWorkbench.Interfaces (in SqlWorkbench.Interfaces.dll)

Syntax

'Declaration
Function CreateInstance(Of T) ( _
    type As Type, _
    ParamArray args As Object() _
) As T
'Usage
Dim instance As ISqlActivationService
Dim type As Type
Dim args As Object()
Dim returnValue As T

returnValue = instance.CreateInstance(type, _
    args)
T CreateInstance<T>(
    Type type,
    params Object[] args
)
generic<typename T>
T CreateInstance(
    Type^ type, 
    ... array<Object^>^ args
)
abstract CreateInstance : 
        type:Type * 
        args:Object[] -> 'T 
JScript does not support generic types and methods.

Type Parameters

  • T

Parameters

  • args
    Type: array<System.Object[]
    An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

Return Value

Type: T
A reference to the newly created object.