使用 ADOMD.NET 中的架构行集


当需要的元数据超过 ADOMD.NET 对象模型中提供的元数据时,ADOMD.NET 会提供检索 XML for Analysis (XMLA)、OLE DB、OLE DB for OLAP 以及 OLE DB for Data Mining 的所有架构行集的功能:

  XML for Analysis 元数据
  XML for Analysis 架构行集可提供检索有关服务器的低级别信息的方法。提供的信息包括服务器上可用的数据源、访问接口保留的关键字、访问接口支持的文字等。您甚至可以使用 XML for Analysis 架构行集发现访问接口支持的所有架构行集。

  OLE DB 元数据
OLE DB 架构行集可提供从各种访问接口检索信息的行业标准方法。

  OLAP 元数据
  为分析数据源提供的架构信息包括可从分析数据源获取的数据库或目录、数据库中的多维数据集和挖掘模型、数据源中存在的多维数据集的角色等。

  数据挖掘元数据
  除了 OLAP 元数据之外,还可以使用架构行集检索数据挖掘元数据。可用的行集可公开数据库中的可用数据挖掘模型、可用挖掘算法、算法所需的参数、挖掘结构等相关信息。

  对于每个不同的架构行集,可使用 AdomdConnection 对象的 GetSchemaDataSet 方法通过传递 GUID 或 XMLA 名称从行集检索元数据。

  通过传递 GUID 检索元数据
  AdomdSchemaGuid 类包含一个字段列表,这些字段表示访问接口和分析数据源最常支持的架构行集。若要从访问接口或分析数据源检索常规和特定于访问接口的元数据,可通过下列方法之一使用 AdomdSchemaGuid 对象中包含的 GUID。


Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.Guid,System.Object[])

Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.Guid,System.Object[],System.Boolean)
  注意:
  ADOMD.NET 数据访问接口可通过特定访问接口和分析数据源提供的功能公开架构信息。每个访问接口和数据源都可能提供不同的元数据。

  通过传递 XMLA 名称检索元数据
  以下方法将 XMLA 架构名称作为参数,该架构名称可标识要返回的架构信息,以及一组对这些返回列的限制:


Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.String,Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection)

Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.String,Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection,System.Boolean)

Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.String,System.String,Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection)

Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetSchemaDataSet(System.String,System.String,Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection,System.Boolean)
  每个方法都会返回一个用架构信息填充的 DataSet 对象实例。DataSet 对象来自 Microsoft .NET Framework 类库的 System.Data 命名空间。

  示例
  在以下示例中,GetActions 函数将使用连接、多维数据集名称、坐标和坐标类型,将检索 MDSCHEMA_ACTIONS 行集,并返回在所选坐标中可用的操作。


Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->//The following function can be called with the following data:
//ae.GetActions(conn, "Adventure Works","[Geography].[City]",6 );

//This would return a DataSet containing the actions available for cells
//in the Adventure Works cube on [Geography].[City].
private System.Data.DataSet GetActions(AdomdConnection Connection, string Cube, string Coordinate, int CoordinateType)
{
    //Create a restriction collection to restrict the schema information to be returned.
    AdomdRestrictionCollection restrictions= new AdomdRestrictionCollection();
    restrictions.Add("CUBE_NAME", Cube);
    restrictions.Add("COORDINATE", Coordinate);
    restrictions.Add("COORDINATE_TYPE", CoordinateType); //6 = Cell coordinate

    //Open and return a schema rowset, given the correct restictions
    return Connection.GetSchemaDataSet("MDSCHEMA_ACTIONS", restrictions);
}


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3