共用方式為


IMetaDataTables::GetColumnInfo 方法

取得指定資料表中指定資料行的相關資料。

語法

HRESULT GetColumnInfo (
    [in]  ULONG        ixTbl,  
    [in]  ULONG        ixCol,  
    [out] ULONG        *poCol,  
    [out] ULONG        *pcbCol,  
    [out] ULONG        *pType,  
    [out] const char   **ppName  
);  

參數

=======

ixTbl
[in] 所需資料表的索引。

ixCol
[in] 所需資料行的索引。

poCol
[out] 資料列中資料行位移的指標。

pcbCol
[out] 資料行大小的指標,以位元組為單位。

pType
[out] 資料行中值的型別的指標。

ppName
[out] 資料行名稱指標的指標。

備註

傳回的資料行類型落在範圍值內:

pType 描述 Helper 函式
0..iRidMax
(0..63)
RID IsRidType
IsRidOrToken
iCodedToken..iCodedTokenMax
(64..95)
Coded 語彙基元 IsCodedTokenType
IsRidOrToken
iSHORT (96) Int16 IsFixedType
iUSHORT (97) UInt16 IsFixedType
iLONG (98) Int32 IsFixedType
iULONG (99) UInt32 IsFixedType
iBYTE (100) Byte IsFixedType
iSTRING (101) String IsHeapType
iGUID (102) Guid IsHeapType
iBLOB (103) Blob IsHeapType

儲存在堆積的值,(也就是 IsHeapType == true) 可以使用下列方式讀取:

  • iSTRING: IMetadataTables.GetString
  • iGUID: IMetadataTables.GetGUID
  • iBLOB: IMetadataTables.GetBlob

重要

若要使用上述表格中定義的常數,請包含 cor.h 標頭檔所提供的指示詞 #define _DEFINE_META_DATA_META_CONSTANTS

規格需求

平台:請參閱系統需求

標頭:Cor.h

程式庫:作為 MSCorEE.dll 中的資源使用

.NET Framework版本:自 1.0 起提供

另請參閱