DataType Constructor (SqlDataType)

Initializes a new instance of the DataType class based on a specified SQL Server data type.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
Public Sub New ( _
    sqlDataType As SqlDataType _
)
'Usage
Dim sqlDataType As SqlDataType

Dim instance As New DataType(sqlDataType)
public DataType(
    SqlDataType sqlDataType
)
public:
DataType(
    SqlDataType sqlDataType
)
new : 
        sqlDataType:SqlDataType -> DataType
public function DataType(
    sqlDataType : SqlDataType
)

Parameters

Examples

Visual Basic

Dim dt As DataType
dt = New DataType(SqlDataType.Int)

PowerShell

$dt = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::Int)