Bewerken

Delen via


AMO Fundamental Classes

Applies to: SQL Server Analysis Services Azure Analysis Services Fabric/Power BI Premium

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.

AMO Fundamental Classes

Server objects

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 Server in the Microsoft.AnalysisServices.

Database objects

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.

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 Database in the Microsoft.AnalysisServices.

DataSource and DataSourceView Objects

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 DataSource and DataSourceView in the Microsoft.AnalysisServices.