Converts a system TypeCode to a Integration ServicesVariant data type. This method is not CLS-compliant.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public Shared Function VarTypeFromTypeCode ( _
typeCode As TypeCode _
) As UShort
public static ushort VarTypeFromTypeCode (
TypeCode typeCode
)
public:
static unsigned short VarTypeFromTypeCode (
TypeCode typeCode
)
public static UInt16 VarTypeFromTypeCode (
TypeCode typeCode
)
public static function VarTypeFromTypeCode (
typeCode : TypeCode
) : ushort
매개 변수
- typeCode
The system TypeCode to convert to the SSIS type.
반환 값
The SSIS type for the system TypeCode.
주의
For a list of the SSIS types, see Integration Services 데이터 형식.
The following table shows the TypeCode and what SSIS Variant data type they are converted to.
System TypeCode |
Variant Data Type |
System.TypeCode.Empty |
VT_EMPTY |
System.TypeCode.DBNull |
VT_NULL |
System.TypeCode.Int16 |
VT_I2 |
System.TypeCode.Int32 |
VT_I4 |
System.TypeCode.Single |
VT_R4 |
System.TypeCode.Double |
VT_R8 |
System.TypeCode.Decimal |
VT_CY |
System.TypeCode.DateTime |
VT_DATE |
System.TypeCode.String |
VT_BSTR |
System.TypeCode.Object |
VT_DISPATCH |
System.TypeCode.Object |
VT_ERROR |
System.TypeCode.Boolean |
VT_BOOL |
System.TypeCode.Object |
VT_VARIANT |
System.TypeCode.Object |
VT_UNKNOWN |
System.TypeCode.Decimal |
VT_DECIMAL |
System.TypeCode.SByte |
VT_I1 |
System.TypeCode.Byte |
VT_UI1 |
System.TypeCode.UInt16 |
VT_UI2 |
System.TypeCode.UInt32 |
VT_UI4 |
System.TypeCode.Int64 |
VT_I8 |
System.TypeCode.UInt64 |
VT_UI8 |
System.TypeCode.Int16 |
VT_INT |
System.TypeCode.UInt16 |
VT_UINT |
System.TypeCode.Empty |
VT_VOID |
예
The following example shows a pipeline component that overrides the RegisterEvents method and creates a custom event using the EventInfos collection, using the VarTypeFromTypeCode to create a reference type.
Public override void RegisterEvents()
{
string []parameters = new string[1]{"Parameter1"};
ushort []types = new ushort[1]{DtsConvert.VarTypeFromTypeCode(TypeCode.String)};
string []descriptions = new string [1]{"The first parameter."};
EventInfos.Add("OnPreExecute", "Fires when the PreExecute method runs.", false, ref parameters, ref types, ref descriptions);
}
Public Overrides Sub RegisterEvents()
String ()parameters = New String(1)
{
"Parameter1"
}
System.UInt16 ()types = New System.UInt16(1)
{
DtsConvert.VarTypeFromTypeCode(TypeCode.String)
}
String ()descriptions = New String (1)
{
"The first parameter."
}
EventInfos.Add("OnPreExecute", "Fires when the PreExecute method runs.", False, parameters, types, descriptions)
End Sub
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
DtsConvert Class
DtsConvert Members
Microsoft.SqlServer.Dts.Runtime Namespace