次の方法で共有


MeasureCollection Class

CubeDef に含まれる Measures オブジェクトの読み取り専用の要求時コレクションを取得します。

名前空間: Microsoft.AnalysisServices.AdomdClient
アセンブリ: Microsoft.AnalysisServices.AdomdClient (microsoft.analysisservices.adomdclient.dll 内)

構文

'宣言
<DefaultMemberAttribute("Item")> _
Public NotInheritable Class MeasureCollection
    Implements ICollection, IEnumerable
[DefaultMemberAttribute("Item")] 
public sealed class MeasureCollection : ICollection, IEnumerable
[DefaultMemberAttribute(L"Item")] 
public ref class MeasureCollection sealed : ICollection, IEnumerable
/** @attribute DefaultMemberAttribute("Item") */ 
public final class MeasureCollection implements ICollection, IEnumerable
DefaultMemberAttribute("Item") 
public final class MeasureCollection implements ICollection, IEnumerable

継承階層

System.Object
  Microsoft.AnalysisServices.AdomdClient.MeasureCollection

使用例

次のサブルーチンでは、CubeDef を受け取り、Measures コレクションの繰り返し処理を実行し、各メジャーの情報を表示します。

Public Sub ListMeasureCollection(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 Measures collection of the
        ' CubeDef object.

        Try
            Dim measureToCheck As Measure

            Debug.WriteLine("Found " & CubeToCheck.Measures.Count & _
                " measure(s) in cube:")

            For Each measureToCheck In CubeToCheck.Measures
                Debug.WriteLine("Measure:  " & measureToCheck.Name)
                Debug.WriteLine("  Caption:        " & _
                    measureToCheck.Caption)
                Debug.WriteLine("  Description:    " & _
                    measureToCheck.Description)

            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

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

MeasureCollection Members
Microsoft.AnalysisServices.AdomdClient Namespace