NamedSet 類別

Represents a named set for a given cube.

繼承階層

System.Object
  Microsoft.AnalysisServices.AdomdClient.NamedSet

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

語法

'宣告
Public NotInheritable Class NamedSet
'用途
Dim instance As NamedSet
public sealed class NamedSet
public ref class NamedSet sealed
[<SealedAttribute>]
type NamedSet =  class end
public final class NamedSet

NamedSet 型別公開下列成員。

屬性

  名稱 說明
公用屬性 Caption Gets the caption of the named set.
公用屬性 Description Gets the description of the NamedSet.
公用屬性 DisplayFolder Gets the fully qualified name of a display folder.
公用屬性 Expression Gets the MDX set expression that defines the NamedSet.
公用屬性 Name Gets the name of the NamedSet.
公用屬性 ParentCube Gets a CubeDef that contains the NamedSet.
公用屬性 Properties Gets a PropertyCollection that contains the properties associated with the NamedSet.

上層

方法

  名稱 說明
公用方法 Equals Determines whether two instances of NamedSet are equal. (覆寫 Object.Equals(Object)。)
公用方法 GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures such as hash tables. (覆寫 Object.GetHashCode()。)
公用方法 GetType (繼承自 Object。)
公用方法 ToString Returns a String that represents the current object. (覆寫 Object.ToString()。)

上層

運算子

  名稱 說明
公用運算子靜態成員 Equality Determines whether two specified instances of NamedSet the same values.
公用運算子靜態成員 Inequality Determines whether two specified instances of NamedSet have different values.

上層

備註

A named set is a persisted set expression, which is associated with an alias and defined as part of the structure of a cube. In Multidimensional Expressions (MDX), a set expression can be a lengthy and complex declaration. A named set makes it easier to manage a set expression that is used regularly in MDX or XML for Analysis queries that involve the cube and provides a way of maintaining the set expression independently of the queries that use it.

A NamedSet encapsulates the alias and set expression of a named set, so that the metadata of the named set can be examined and incorporated into queries.

範例

The following subroutine, given a CubeDef, iterates through the NamedSets collection and displays information about each NamedSet in the collection:

Public Sub ListNamedSets(ByRef CubeToCheck As CubeDef)

    ' Check the parameter before performing actions on it.
    If CubeToCheck Is Nothing Then
        Throw New System.ArgumentNullException("CubeToCheck")
    Else
        ' Iterate through the NamedSets collection of the
        ' CubeDef object.

        Try
            Dim nsetToCheck As NamedSet

            Debug.WriteLine("Found " & CubeToCheck.NamedSets.Count & _
                " named set(s) in cube:")

            For Each nsetToCheck In CubeToCheck.NamedSets
                Debug.WriteLine("Named Set:  " & nsetToCheck.Name)
                Debug.WriteLine("    Description:  " & _
                    nsetToCheck.Description)
                Debug.WriteLine("    Expression:   " & _
                    nsetToCheck.Expression)
            Next
        Catch ex As AdomdConnectionException
            ' The connection could not be opened or was disconnected.
            ' This error can occur at any time, if the provider is 
            ' disconnected from the server.
            Debug.WriteLine(ex)
            Throw ex
        Catch ex As AdomdErrorResponseException
            ' A response is received from a provider which indicates an error.
            Debug.WriteLine(ex)
            Throw ex
        Catch ex As AdomdUnknownResponseException
            ' A response has been returned from the provider that 
            ' was not understood.
            Debug.WriteLine(ex)
            Throw ex
        Catch ex As AdomdCacheExpiredException
            ' A cached version of an ADOMD.NET object is no longer valid.
            ' This error is typically raised when reviewing metadata.
            Debug.WriteLine(ex)
            Throw ex
        Catch ex As AdomdException
            ' Any other error raised by ADOMD.NET.
            Debug.WriteLine(ex)
            Throw ex
        Catch ex As Exception
            ' Any other error.
            Debug.WriteLine(ex)
            Throw ex
        End Try
    End If
End Sub

執行緒安全性

這個型別的任何公用 static (在 Visual Basic 中為 Shared) 成員都是執行緒安全的。並不是所有的執行個體成員都保證可以用於所有的執行緒。

請參閱

參考

Microsoft.AnalysisServices.AdomdClient 命名空間