共用方式為


Context.CurrentMiningModel 屬性

Gets the current mining model.

命名空間:  Microsoft.AnalysisServices.AdomdServer
組件:  msmgdsrv (在 msmgdsrv.dll 中)

語法

'宣告
Public Shared ReadOnly Property CurrentMiningModel As MiningModel 
    Get
'用途
Dim value As MiningModel 

value = Context.CurrentMiningModel
public static MiningModel CurrentMiningModel { get; }
public:
static property MiningModel^ CurrentMiningModel {
    MiningModel^ get ();
}
static member CurrentMiningModel : MiningModel
static function get CurrentMiningModel () : MiningModel

屬性值

型別:Microsoft.AnalysisServices.AdomdServer.MiningModel
A MiningModel that represents the current mining model; nullnull 參考 (在 Visual Basic 中為 Nothing) if not applicable.

備註

The return value will be nullnull 參考 (在 Visual Basic 中為 Nothing) when called from a Multidimensional Expressions (MDX) query, or as a stored procedure. For more information on the differences between user-defined functions (UDFs) and stored orocedures, see 使用者定義函數和預存程序.

範例

In the following example, a UDF is created that returns the node description for a specified node. It uses the current context in which it is being run, retrieves the node from the current mining model (determined by the DMX FROM clause):

public string GetNodeDescription(string nodeUniqueName)
{
    return Context.CurrentMiningModel.GetNodeFromUniqueName(nodeUniqueName).Description;
}

請參閱

參考

Context 類別

Microsoft.AnalysisServices.AdomdServer 命名空間