Condividi tramite


AMO Fundamental Classes

Data aggiornamento: 14 aprile 2006

Fundamental classes are the starting point for working with Analysis Management Objects (AMO). Through these classes you establish your environment for the rest of the objects that will be used in your application. Fundamental classes include the following objects: Server, Database, DataSource, and DataSourceView.

The following illustration shows the relationship of the classes that are explained in this topic.

Classi fondamentali AMO

This topic contains the following sections:

  • Server Objects
  • Database Objects
  • DataSource and DataSourceView Objects

Server Objects

The Server object represents the server and the instance of Microsoft SQL Server 2005 Analysis Services (SSAS) that you want to work with.

As soon as you have a connected instance of Analysis Services, you will be able to see:

  • All databases that you can access, as a collection.
  • All defined server properties, as a collection.
  • The connection string, the connection information, and the session ID.
  • The product name, edition, and version.
  • The roles collections.
  • The traces collection.
  • The assemblies collection.

Additionally, you will have access to the following methods:

  • Connection management: Connect, Disconnect, Reconnect, and GetConnectionState.
  • Transaction management: BeginTransaction, CommitTransaction, and RollbackTransaction.
  • Backup and Restore.
  • DDL execution: Execute, CancelCommand, SendXmlaRequest, StartXmlaRequest.
  • Metadata management: UpdateObjects and Validate.

To connect to a server, you need a standard connection string, as used in ADOMD.NET and OLEDB. For more information, see ConnectionString. The name of the server can be specified as a connection string without having to use a connection string format.

For more information about methods and properties available, see Microsoft.AnalysisServices.Server in the Microsoft.AnalysisServices namespace.

Database Objects

The Database object is the container for all data objects that are needed for a business intelligence project (such as OLAP cubes, dimensions, and data mining structures), and their supporting objects (such as DataSource, Account, and Role).

To work with a Database object in your application, you must get an instance of the database from the parent server databases collection. To create a database, you add a Database object to a server databases collection and update the new instance to the server. To delete a database, you drop the Database object by using its own Drop method.

A Database object provides access to objects and attributes that include the following:

  • All cubes that you can access, as a collection.
  • All dimensions that you can access, as a collection.
  • All mining structures that you can access, as a collection.
  • All data sources and data source views, as two collections.
  • All roles and database permissions, as two collections.
  • The collation value for the database.
  • The estimated size of the database.
  • The language value of the database.
  • The visible setting for the database.

Databases can be backed up by using the BackUp method (from the Database object or from the Server object), but can only be restored from the Server object with the Restore method.

For more information about methods and properties available, see Microsoft.AnalysisServices.Database in the Microsoft.AnalysisServices namespace.

DataSource and DataSourceView Objects

Data sources connect Analysis Services to the data outside of Analysis Services. The connection to the physical data is defined by the connection string property of the data source. The data source can be a native OLE DB provider or a managed .NET Framework data provider. The connection string contains server name, database, security, time-out, and other connection-related information. The elements of a connection string can vary from one provider to another. The user should verify what elements are required in the connection string with the data provider.

A data source view is a logical representation of the data that is used by Analysis Services objects. A data source view is built from the data sources already defined in the database. A data source view contains the metadata that is required to build the data model required by an Analysis Services object. A data source view can build the data model from some of the data elements in one data source, or it can build the data model from multiple elements from different data sources. A data source view can contain relationships, calculated columns, and queries that are not present in the underlying data sources.

Data sources are managed by using the DataSourceCollection from the database class. An instance of DataSource can be created by using the Add method from a DataSourceCollection object. An instance of DataSource can be deleted by using the Remove method from a DataSourceCollection object.

DataSourceView objects are managed from the DataSourceViewCollection object in the database class.

For more information about methods and properties available, see Microsoft.AnalysisServices.DataSource and Microsoft.AnalysisServices.DataSourceView in the Microsoft.AnalysisServices namespace.

Change History

Release History

14 aprile 2006

New content:
  • Added an illustration showing the relationships between the objects covered in this topic.

Vedere anche

Riferimento

Microsoft.AnalysisServices

Concetti

Introducing AMO Classes
Programming AMO Fundamental Objects

Guida in linea e informazioni

Assistenza su SQL Server 2005